[PATCH AUTOSEL 6.18-6.1] RDMA/irdma: Fix typo in SQ completions generation

From: Sasha Levin

Date: Mon Aug 31 2026 - 13:06:38 EST


From: Cyrill Gorcunov <gorcunov@xxxxxxxxx>

[ Upstream commit b548a6c4eee5c428663f3944e173e6c92e2e8d6f ]

When we generate completion for SQ the opcode while being properly read
from ring buffer is ignored when written back to completion. Seems
to be a simple typo.

Link: https://patch.msgid.link/r/ahjB87k54bYdFbft@grain
Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
Reviewed-by: Jacob Moroni <jmoroni@xxxxxxxxxx>
Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---

LLM Generated explanations, may be completely bogus:

The background search finished: the fix commit is **not in this v6.18.44
tree** (`git log --grep` for the subject returned nothing). The buggy
line is still at `utils.c:2464`.

**Verdict: YES** — one-line typo in the kernel-client SQ flush path. It
always sets `op_type` to `0x3f`, which breaks NOP filtering and
overwrites flush status with `IB_WC_GENERAL_ERR` instead of
`IB_WC_WR_FLUSH_ERR`. Low risk, clearly correct, and appropriate for
stable backport.

drivers/infiniband/hw/irdma/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
index e5e226b346211..8442e4fb3f984 100644
--- a/drivers/infiniband/hw/irdma/utils.c
+++ b/drivers/infiniband/hw/irdma/utils.c
@@ -2461,7 +2461,7 @@ void irdma_generate_flush_completions(struct irdma_qp *iwqp)
cmpl->cpi.wr_id = qp->sq_wrtrk_array[wqe_idx].wrid;
sw_wqe = qp->sq_base[wqe_idx].elem;
get_64bit_val(sw_wqe, 24, &wqe_qword);
- cmpl->cpi.op_type = (u8)FIELD_GET(IRDMAQPSQ_OPCODE, IRDMAQPSQ_OPCODE);
+ cmpl->cpi.op_type = (u8)FIELD_GET(IRDMAQPSQ_OPCODE, wqe_qword);
cmpl->cpi.q_type = IRDMA_CQE_QTYPE_SQ;
/* remove the SQ WR by moving SQ tail*/
IRDMA_RING_SET_TAIL(*sq_ring,
--
2.53.0