From: Xinghai Cen cenxinghai@h-partners.com
mainline inclusion: libhns: Fix missing fields for SRQ WC
Modify the information of some patch Fixes
Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- ...x-memory-leakage-when-DCA-is-enabled.patch | 7 +- ...ump-during-QP-destruction-when-send_.patch | 4 +- ...libhns-Fix-missing-fields-for-SRQ-WC.patch | 82 +++++++++++++++++++ rdma-core.spec | 9 +- 4 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 0043-libhns-Fix-missing-fields-for-SRQ-WC.patch
diff --git a/0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch b/0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch index e1763f7..f046264 100644 --- a/0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch +++ b/0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch @@ -1,4 +1,4 @@ -From edaf09dbfc7203ea68becfcb56eecf4af31ba555 Mon Sep 17 00:00:00 2001 +From af20dd32df73ff72d35a430a5fb87ac42d70cdf4 Mon Sep 17 00:00:00 2001 From: wenglianfa wenglianfa@huawei.com Date: Thu, 25 Jul 2024 11:06:01 +0800 Subject: [PATCH] libhns: Fix memory leakage when DCA is enabled @@ -13,8 +13,7 @@ After DCA is enabled and a QP is created, the memory block applied for DCA is not free when the QP is destroyed. Here fix it.
-Fixes: 41e39ab792c8 ("[BigDipperV3R9,NeZha][ROCE] libhns: Add support for at taching QP's WQE buffer") - +Fixes: 2783884a97e7 ("libhns: Add support for attaching QP's WQE buffer") Signed-off-by: wenglianfa wenglianfa@huawei.com Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- @@ -36,5 +35,5 @@ index e30880c..c733b21 100644
static int qp_alloc_wqe(struct ibv_qp_init_attr_ex *attr, -- -2.25.1 +2.33.0
diff --git a/0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch b/0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch index b3ee84f..2e9f546 100644 --- a/0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch +++ b/0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch @@ -1,4 +1,4 @@ -From 263479c6fb4712528ccae276960ec94fd77afc51 Mon Sep 17 00:00:00 2001 +From 83784fc2538d24f3f06f023c21cc045d5b7f44ce Mon Sep 17 00:00:00 2001 From: Yuyu Li liyuyu6@huawei.com Date: Mon, 25 Nov 2024 16:13:48 +0800 Subject: [PATCH] libhns: Fix coredump during QP destruction when send_cq == @@ -24,7 +24,7 @@ coredump info: 0x0000ffff8feae39c in __ibv_create_qp_1_1 0x0000000000401420 in test_ctrl_path
-Fixes: 95e05809d2d2 ("[BigDipperV3R9,NeZha][ROCE] libhns: Support reporting wc as software mode") +Fixes: 5494e44cf97e ("Support reporting wc as software mode.") Signed-off-by: Yuyu Li liyuyu6@huawei.com Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- diff --git a/0043-libhns-Fix-missing-fields-for-SRQ-WC.patch b/0043-libhns-Fix-missing-fields-for-SRQ-WC.patch new file mode 100644 index 0000000..4058094 --- /dev/null +++ b/0043-libhns-Fix-missing-fields-for-SRQ-WC.patch @@ -0,0 +1,82 @@ +From b52618371517527ce8ea4b8f5bd2571c7f69a2ba Mon Sep 17 00:00:00 2001 +From: wenglianfa wenglianfa@huawei.com +Date: Wed, 15 Jan 2025 15:55:29 +0800 +Subject: [PATCH] libhns: Fix missing fields for SRQ WC + +mainline inclusion +from mainline-master +commit 65a7ce99cf4bfd6748346206f546e51c0a82c993 +category: bugfix +bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/IBIEA4 +CVE: NA +Reference: https://github.com/linux-rdma/rdma-core/pull/1543/commits/65a7ce99cf4bfd6748... + +---------------------------------------------------------------------- + +The sl and src_qpn fields in recv-WC are not filled when the QP is UD +and has an SRQ. Here fix it. + +In addition, UD QP does not support RQ INLINE and CQE INLINE features. +Reorder the related if-else statements to reduce the number of +conditional checks in IO path. + +Fixes: 061f7e1757ca ("libhns: Refactor the poll one interface") +Signed-off-by: wenglianfa wenglianfa@huawei.com +Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com +Signed-off-by: Xinghai Cen cenxinghai@h-partners.com +--- + providers/hns/hns_roce_u_hw_v2.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c +index 0628646..aadea7a 100644 +--- a/providers/hns/hns_roce_u_hw_v2.c ++++ b/providers/hns/hns_roce_u_hw_v2.c +@@ -519,7 +519,8 @@ static void parse_for_ud_qp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc) + } + + static void parse_cqe_for_srq(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc, +- struct hns_roce_srq *srq) ++ struct hns_roce_srq *srq, ++ struct hns_roce_qp *hr_qp) + { + uint32_t wqe_idx; + +@@ -529,6 +530,8 @@ static void parse_cqe_for_srq(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc, + + if (hr_reg_read(cqe, CQE_CQE_INLINE)) + handle_recv_cqe_inl_from_srq(cqe, srq); ++ else if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD) ++ parse_for_ud_qp(cqe, wc); + } + + static void parse_cqe_for_resp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc, +@@ -540,13 +543,13 @@ static void parse_cqe_for_resp(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc, + wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; + ++wq->tail; + +- if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD) +- parse_for_ud_qp(cqe, wc); +- + if (hr_reg_read(cqe, CQE_CQE_INLINE)) + handle_recv_cqe_inl_from_rq(cqe, hr_qp); + else if (hr_reg_read(cqe, CQE_RQ_INLINE)) + handle_recv_rq_inl(cqe, hr_qp); ++ else if (hr_qp->verbs_qp.qp.qp_type == IBV_QPT_UD) ++ parse_for_ud_qp(cqe, wc); ++ + } + + static void parse_cqe_for_req(struct hns_roce_v2_cqe *cqe, struct ibv_wc *wc, +@@ -753,7 +756,7 @@ static int parse_cqe_for_cq(struct hns_roce_context *ctx, struct hns_roce_cq *cq + return V2_CQ_POLL_ERR; + + if (srq) +- parse_cqe_for_srq(cqe, wc, srq); ++ parse_cqe_for_srq(cqe, wc, srq, cur_qp); + else + parse_cqe_for_resp(cqe, wc, cur_qp); + } +-- +2.33.0 + diff --git a/rdma-core.spec b/rdma-core.spec index 035faf7..8fd61b8 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 50.0 -Release: 20 +Release: 21 Summary: RDMA core userspace libraries and daemons License: GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause Url: https://github.com/linux-rdma/rdma-core @@ -48,6 +48,7 @@ patch39: 0039-libhns-Fix-the-exception-branch-of-wr_start-is-not-l.patch patch40: 0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch patch41: 0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch patch42: 0042-libhns-Add-error-logs-to-help-diagnosis.patch +patch43: 0043-libhns-Fix-missing-fields-for-SRQ-WC.patch
BuildRequires: binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) systemd systemd-devel @@ -623,6 +624,12 @@ fi %doc %{_docdir}/%{name}-%{version}/70-persistent-ipoib.rules
%changelog +* Fri Jan 17 2025 Xinghai Cen cenxinghai@h-partners.com - 50.0-21 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: Fix missing fields for SRQ WC + * Wed Jan 08 2025 Funda Wang fundawang@yeah.net - 50.0-20 - Type: bugfix - ID: NA
high-performance-network@openeuler.org