]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/hns: Fix wrong WQE data when QP wraps around
authorJunxian Huang <huangjunxian6@hisilicon.com>
Thu, 16 Oct 2025 11:40:50 +0000 (19:40 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 27 Oct 2025 09:44:00 +0000 (05:44 -0400)
commitfe9622011f955e35ba84d3af7b2f2fed31cf8ca1
tree55cf235a871940c22b71539436cf2707d1bde341
parentf5a7cbea5411668d429eb4ffe96c4063fe8dac9e
RDMA/hns: Fix wrong WQE data when QP wraps around

When QP wraps around, WQE data from the previous use at the same
position still remains as driver does not clear it. The WQE field
layout differs across different opcodes, causing that the fields
that are not explicitly assigned for the current opcode retain
stale values, and are issued to HW by mistake. Such fields are as
follows:

* MSG_START_SGE_IDX field in ATOMIC WQE
* BLOCK_SIZE and ZBVA fields in FRMR WQE
* DirectWQE fields when DirectWQE not used

For ATOMIC WQE, always set the latest sge index in MSG_START_SGE_IDX
as required by HW.

For FRMR WQE and DirectWQE, clear only those unassigned fields
instead of the entire WQE to avoid performance penalty.

Fixes: 68a997c5d28c ("RDMA/hns: Add FRMR support for hip08")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20251016114051.1963197-4-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c