Skip to content

Commit

Permalink
libibverbs: Fix incorrect return code
Browse files Browse the repository at this point in the history
The proper return code is EOPNOTSUPP when an operation is not supported.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
  • Loading branch information
Kamalheib committed Jan 19, 2020
1 parent 6f60af9 commit c284107
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 108 deletions.
8 changes: 4 additions & 4 deletions libibverbs/cmd.c
Expand Up @@ -303,7 +303,7 @@ int ibv_cmd_open_xrcd(struct ibv_context *context, struct verbs_xrcd *xrcd,
int ret;

if (attr->comp_mask >= IBV_XRCD_INIT_ATTR_RESERVED)
return ENOSYS;
return EOPNOTSUPP;

if (!(attr->comp_mask & IBV_XRCD_INIT_ATTR_FD) ||
!(attr->comp_mask & IBV_XRCD_INIT_ATTR_OFLAGS))
Expand Down Expand Up @@ -544,7 +544,7 @@ int ibv_cmd_create_srq_ex(struct ibv_context *context,
int ret;

if (attr_ex->comp_mask >= IBV_SRQ_INIT_ATTR_RESERVED)
return ENOSYS;
return EOPNOTSUPP;

if (!(attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_PD))
return EINVAL;
Expand Down Expand Up @@ -863,7 +863,7 @@ int ibv_cmd_create_qp_ex(struct ibv_context *context,
IBV_QP_INIT_ATTR_PD |
IBV_QP_INIT_ATTR_XRCD |
IBV_QP_INIT_ATTR_SEND_OPS_FLAGS))
return ENOSYS;
return EOPNOTSUPP;

err = create_qp_ex_common(qp, attr_ex, vxrcd,
&cmd->core_payload);
Expand Down Expand Up @@ -964,7 +964,7 @@ int ibv_cmd_open_qp(struct ibv_context *context, struct verbs_qp *qp,
int ret;

if (attr->comp_mask >= IBV_QP_OPEN_ATTR_RESERVED)
return ENOSYS;
return EOPNOTSUPP;

if (!(attr->comp_mask & IBV_QP_OPEN_ATTR_XRCD) ||
!(attr->comp_mask & IBV_QP_OPEN_ATTR_NUM) ||
Expand Down
2 changes: 1 addition & 1 deletion libibverbs/driver.h
Expand Up @@ -639,7 +639,7 @@ static inline int verbs_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num)
*srq_num = vsrq->srq_num;
return 0;
}
return ENOSYS;
return EOPNOTSUPP;
}

static inline bool check_comp_mask(uint64_t input, uint64_t supported)
Expand Down

0 comments on commit c284107

Please sign in to comment.