From 83bf7d432a3c1bdf35a5fc19a4c1c771c8a971ec Mon Sep 17 00:00:00 2001 From: Tatyana Nikolova Date: Mon, 13 May 2024 14:53:38 -0500 Subject: [PATCH] providers/irdma: Fix the number of CQEs attribute returned in create_ex CQ. [ Upstream commit 2796a42b1aacecb4a764eb49783a7b07d974d52e ] When an application creates extended CQ, irdma library modifies the attribute attr_ex->cqe by doubling it to accommodate for immediate data. This number should not be reported back to the application. Fix this by restoring the attr_ex->cqe to the original value. Unit tests CqExOpTest.BasicPollSend/RecvCq are seeing this issue, i.e. CQ create failed since the application created the second CQE with 2 * max CQ size. Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs") Signed-off-by: Tatyana Nikolova Signed-off-by: Shiraz Saleem Signed-off-by: Nicolas Morey --- providers/irdma/uverbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/irdma/uverbs.c b/providers/irdma/uverbs.c index 20b516cf4..7c5ec95f4 100644 --- a/providers/irdma/uverbs.c +++ b/providers/irdma/uverbs.c @@ -410,6 +410,7 @@ static struct ibv_cq_ex *ucreate_cq(struct ibv_context *context, ret = ibv_cmd_create_cq_ex(context, attr_ex, &iwucq->verbs_cq, &cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp, sizeof(resp), 0); + attr_ex->cqe = ncqe; if (ret) { errno = ret; goto err_dereg_shadow;