Skip to content

Commit

Permalink
check need mr reg before calling ft_regv_mr
Browse files Browse the repository at this point in the history
  • Loading branch information
shijin-aws committed Nov 6, 2023
1 parent 632e145 commit c24629a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ int ft_reg_mr(struct fi_info *fi, void *buf, size_t size, uint64_t access,
struct fid_mr **mr, void **desc)
{
struct iovec iov;

if (!ft_need_mr_reg(fi))
return 0;

iov.iov_base = buf;
iov.iov_len = size;
return ft_regv_mr(fi, &iov, 1, access, key, iface, device, mr, desc);
Expand All @@ -436,9 +440,6 @@ int ft_regv_mr(struct fi_info *fi, struct iovec *iov, size_t iov_count,
struct fi_mr_dmabuf *dmabuf;
size_t i;

if (!ft_need_mr_reg(fi))
return 0;

dmabuf = calloc(iov_count, sizeof(*dmabuf));
if (!dmabuf) {
perror("calloc for dmabuf");
Expand Down

0 comments on commit c24629a

Please sign in to comment.