From 906b2106bc7974d499fa67ee90bfd49e960fd4b3 Mon Sep 17 00:00:00 2001 From: Mohammad Heib Date: Thu, 31 Oct 2024 05:59:04 -0400 Subject: [PATCH] bnxt_re: set errno to 'EINVAL' in cq creation bad flow 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 --- providers/bnxt_re/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index e35f665b3..18e6893d5 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -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)