]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:35 +0000 (15:37 -0500)
commit00b56d28dd7f7154bea6fabaadd3a2a7dff3cb66
treee7fbb967ae4484fa626e02981207c10d1dbff857
parentac63f8ebcd7ca816bcdd846ff3524954fe01378c
RDMA/hns: Fix wrong WQE data when QP wraps around

[ Upstream commit fe9622011f955e35ba84d3af7b2f2fed31cf8ca1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c