Skip to content

Commit

Permalink
bnxt_re: set errno to 'EINVAL' in cq creation bad flow
Browse files Browse the repository at this point in the history
Currently when the user creates a CQ with CQEs greater than
the device max_depth bnxt_re lib will catch this error flow
and return immediately without creating a CQ, some test cases
expect to have EINVAL in errno which is not set by bnxt.

This patch updates the bnxt_re lib to set the errno to EINVAL in case of
bad cq creation flow.

Signed-off-by: Mohammad Heib <mheib@redhat.com>
  • Loading branch information
mohammadheib committed Nov 5, 2024
1 parent 8ac2197 commit 906b210
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion providers/bnxt_re/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,10 @@ struct ibv_cq *bnxt_re_create_cq(struct ibv_context *ibvctx, int ncqe,
struct bnxt_re_context *cntx = to_bnxt_re_context(ibvctx);
struct bnxt_re_dev *dev = to_bnxt_re_dev(ibvctx->device);

if (ncqe > dev->max_cq_depth)
if (ncqe > dev->max_cq_depth) {
errno = EINVAL;
return NULL;
}

cq = calloc(1, (sizeof(*cq) + sizeof(struct bnxt_re_queue)));
if (!cq)
Expand Down

0 comments on commit 906b210

Please sign in to comment.