From 7bc0c665bd1ebc20f399af4248d3dc8bef0454fa Mon Sep 17 00:00:00 2001 From: Donghua Huang Date: Mon, 27 Oct 2025 15:41:29 +0800 Subject: [PATCH] libhns Fix wrong WQE data when QP wraps around Signed-off-by: Donghua Huang --- ...-wrong-WQE-data-when-QP-wraps-around.patch | 42 +++++++++++++++++++ rdma-core.spec | 9 +++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch diff --git a/0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch b/0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch new file mode 100644 index 0000000..27f706a --- /dev/null +++ b/0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch @@ -0,0 +1,42 @@ +From e10940b106d1ccb80dd2496e5fdf7ca615dd5d7b Mon Sep 17 00:00:00 2001 +From: Junxian Huang +Date: Fri, 17 Oct 2025 15:23:57 +0800 +Subject: [PATCH] libhns: Fix wrong WQE data when QP wraps around + +driver inclusion +category: bugfix +bugzilla: https://gitee.com/openeuler/kernel/issues/ID3N81 + +---------------------------------------------------------------------- +cd .. + +DirectWQE fields are not assigned or cleared explicitly when +DirectWQE not used. When QP wraps around, data in these fields +from the previous use at the same position still remains and +are issued to HW by mistake. Clear these fields before issuing +doorbell to HW. + +Fixes: 159933c37450 ("libhns: Add support for direct wqe") +Signed-off-by: Junxian Huang +Signed-off-by: Donghua Huang +--- + providers/hns/hns_roce_u_hw_v2.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c +index 8f071e1..4dc1ecb 100644 +--- a/providers/hns/hns_roce_u_hw_v2.c ++++ b/providers/hns/hns_roce_u_hw_v2.c +@@ -1639,6 +1639,9 @@ int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, + wqe = get_send_wqe(qp, wqe_idx); + qp->sq.wrid[wqe_idx] = wr->wr_id; + ++ /* RC and UD share the same DirectWQE field layout */ ++ ((struct hns_roce_rc_sq_wqe *)wqe)->byte_4 = 0; ++ + switch (ibvqp->qp_type) { + case IBV_QPT_XRC_SEND: + hr_reg_write(wqe, RCWQE_XRC_SRQN, +-- +2.33.0 + diff --git a/rdma-core.spec b/rdma-core.spec index 62716ab..504a933 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 41.0 -Release: 38 +Release: 39 Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core @@ -113,6 +113,7 @@ patch104: 0104-libhns-Clean-up-data-type-issues.patch patch105: 0105-libhns-Add-debug-log-for-lock-free-mode.patch patch106: 0106-libhns-Clean-up-DCA-magic-number-warnings.patch patch107: 0107-libhns-Clean-up-space-tab-blank-line-warnings.patch +patch108: 0108-libhns-Fix-wrong-WQE-data-when-QP-wraps-around.patch BuildRequires: binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) valgrind-devel systemd systemd-devel @@ -365,6 +366,12 @@ fi %{_mandir}/* %changelog +* Mon Oct 27 2025 Donghua Huang - 41.0-39 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: libhns: Fix wrong WQE data when QP wraps around + * Fri Sep 12 2025 zhang_chunjing - 41.0-38 - fix sw_64 error: File not found -- Gitee