rdma-core/0090-libhns-Fix-coredump-during-QP-destruction-when-send_.patch
Xinghai Cen 8bb91c0b8c libhns: Fixed two bugs in libhns
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>
2025-01-03 16:28:34 +08:00

54 lines
1.7 KiB
Diff

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