From: Xinghai Cen cenxinghai@h-partners.com
Fixed two bugs in libhns: libhns: Fix bypassed vendor check in hnsdv_query_device() libhns: Fix coredump during QP destruction when send_cq: == recv_cq
Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- ...sed-vendor-check-in-hnsdv_query_devi.patch | 40 ++++++++++++++ ...ump-during-QP-destruction-when-send_.patch | 53 +++++++++++++++++++ rdma-core.spec | 10 +++- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 0089-libhns-Fix-bypassed-vendor-check-in-hnsdv_query_devi.patch create mode 100644 0090-libhns-Fix-coredump-during-QP-destruction-when-send_.patch
diff --git a/0089-libhns-Fix-bypassed-vendor-check-in-hnsdv_query_devi.patch b/0089-libhns-Fix-bypassed-vendor-check-in-hnsdv_query_devi.patch new file mode 100644 index 0000000..14f2edc --- /dev/null +++ b/0089-libhns-Fix-bypassed-vendor-check-in-hnsdv_query_devi.patch @@ -0,0 +1,40 @@ +From 485cddd47c83d6f229450b28d55d8e07f60ddcc0 Mon Sep 17 00:00:00 2001 +From: Yuyu Li liyuyu6@huawei.com +Date: Thu, 21 Nov 2024 21:37:15 +0800 +Subject: [PATCH] libhns: Fix bypassed vendor check in hnsdv_query_device() + +driver inclusion +category: bugfix +bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/IBF87T + +-------------------------------------------------------------------------- + +The device vendor check is actually bypassed currently due +to the wrong if-condition. It should be a '||' statement. + +Fixes: 19e1eabc154f ("libhns: Add input parameter check for hnsdv_query_device()") +Signed-off-by: Yuyu Li liyuyu6@huawei.com +--- + providers/hns/hns_roce_u_verbs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c +index 090efbf..a6afce2 100644 +--- a/providers/hns/hns_roce_u_verbs.c ++++ b/providers/hns/hns_roce_u_verbs.c +@@ -128,10 +128,10 @@ int hnsdv_query_device(struct ibv_context *context, + struct hns_roce_context *ctx = context ? to_hr_ctx(context) : NULL; + struct hns_roce_device *hr_dev; + +- if (!ctx || !attrs_out) ++ if (!ctx || !context->device || !attrs_out) + return EINVAL; + +- if (!context->device && !is_hns_dev(context->device)) { ++ if (!is_hns_dev(context->device)) { + verbs_err(verbs_get_ctx(context), "not a HNS RoCE device!\n"); + return EOPNOTSUPP; + } +-- +2.33.0 + diff --git a/0090-libhns-Fix-coredump-during-QP-destruction-when-send_.patch b/0090-libhns-Fix-coredump-during-QP-destruction-when-send_.patch new file mode 100644 index 0000000..4909bd3 --- /dev/null +++ b/0090-libhns-Fix-coredump-during-QP-destruction-when-send_.patch @@ -0,0 +1,53 @@ +From ad5055f9b32ab0915803575385985fb10a29434a Mon Sep 17 00:00:00 2001 +From: Yuyu Li liyuyu6@huawei.com +Date: Mon, 25 Nov 2024 15:42:16 +0800 +Subject: [PATCH] libhns: Fix coredump during QP destruction when send_cq + == recv_cq + +driver inclusion +category: bugfix +bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/IBF87T + +-------------------------------------------------------------------------- + +If the specified send CQ and recv CQ are both +the same CQ, the QP node in SCQ is not deleted. +which causes a segfault to occur when recreating +the QP. Here fix it. + +coredump info: +0x0000ffff8fbc37d4 in list_add_before_ +0x0000ffff8fbc381c in list_add_tail_ +0x0000ffff8fbc9d9c in add_qp_to_cq_list +0x0000ffff8fbca008 in create_qp +0x0000ffff8fbca110 in hns_roce_u_create_qp +0x0000ffff8feae39c in __ibv_create_qp_1_1 +0x0000000000401420 in test_ctrl_path + +Fixes: 5bebdb5ba77b ("libhns: Support reporting wc as software mode") +Signed-off-by: Yuyu Li liyuyu6@huawei.com +--- + providers/hns/hns_roce_u_hw_v2.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c +index 8f071e1..48a7566 100644 +--- a/providers/hns/hns_roce_u_hw_v2.c ++++ b/providers/hns/hns_roce_u_hw_v2.c +@@ -2033,9 +2033,10 @@ static int hns_roce_u_v2_destroy_qp(struct ibv_qp *ibqp) + list_del(&qp->rcq_node); + } + +- if (ibqp->send_cq && ibqp->send_cq != ibqp->recv_cq) { +- __hns_roce_v2_cq_clean(to_hr_cq(ibqp->send_cq), ibqp->qp_num, +- NULL); ++ if (ibqp->send_cq) { ++ if (ibqp->send_cq != ibqp->recv_cq) ++ __hns_roce_v2_cq_clean(to_hr_cq(ibqp->send_cq), ibqp->qp_num, ++ NULL); + list_del(&qp->scq_node); + } + +-- +2.33.0 + diff --git a/rdma-core.spec b/rdma-core.spec index 229810a..5e7be99 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 41.0 -Release: 28 +Release: 29 Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core @@ -94,6 +94,8 @@ patch85: 0085-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch patch86: 0086-libhns-Fix-the-exception-branch-of-wr_start-is-not-l.patch patch87: 0087-libhns-Fix-out-of-order-issue-of-requester-when-sett.patch patch88: 0088-libhns-Fix-reference-to-uninitialized-cq-pointer.patch +patch89: 0089-libhns-Fix-bypassed-vendor-check-in-hnsdv_query_devi.patch +patch90: 0090-libhns-Fix-coredump-during-QP-destruction-when-send_.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 @@ -341,6 +343,12 @@ fi %{_mandir}/*
%changelog +* Thu Jan 2 2025 Xinghai Cen cenxinghai@h-partners.com - 41.0-29 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: Fixed two bugs in libhns + * Thu Nov 21 2024 Wentao Hu huwentao19@h-partners.com - 41.0-28 - Type: bugfix - ID: NA
high-performance-network@openeuler.org