2025-03-31 16:51:16 +08:00
|
|
|
From cf0f83bda170e85fe425c02965af3c28be9368aa Mon Sep 17 00:00:00 2001
|
2025-01-07 19:36:49 +08:00
|
|
|
From: wenglianfa <wenglianfa@huawei.com>
|
|
|
|
|
Date: Thu, 25 Jul 2024 11:06:01 +0800
|
|
|
|
|
Subject: [PATCH] libhns: Fix memory leakage when DCA is enabled
|
|
|
|
|
|
|
|
|
|
driver inclusion
|
|
|
|
|
category: feature
|
|
|
|
|
bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/IB66RT
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
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:26e79aa7eb8d ("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>
|
|
|
|
|
---
|
2025-03-31 16:51:16 +08:00
|
|
|
providers/hns/hns_roce_u_verbs.c | 6 +++++-
|
|
|
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
2025-01-07 19:36:49 +08:00
|
|
|
|
|
|
|
|
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
|
2025-03-31 16:51:16 +08:00
|
|
|
index e30880c..bfa25ff 100644
|
2025-01-07 19:36:49 +08:00
|
|
|
--- a/providers/hns/hns_roce_u_verbs.c
|
|
|
|
|
+++ b/providers/hns/hns_roce_u_verbs.c
|
2025-03-31 16:51:16 +08:00
|
|
|
@@ -1357,7 +1357,11 @@ static void qp_free_wqe(struct hns_roce_qp *qp)
|
2025-01-07 19:36:49 +08:00
|
|
|
|
|
|
|
|
if (qp->rq.wqe_cnt)
|
|
|
|
|
free(qp->rq.wrid);
|
|
|
|
|
- hns_roce_free_buf(&qp->buf);
|
2025-03-31 16:51:16 +08:00
|
|
|
+
|
|
|
|
|
+ if (qp->dca_wqe.bufs)
|
|
|
|
|
+ free(qp->dca_wqe.bufs);
|
2025-01-07 19:36:49 +08:00
|
|
|
+ else
|
|
|
|
|
+ hns_roce_free_buf(&qp->buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int qp_alloc_wqe(struct ibv_qp_init_attr_ex *attr,
|
|
|
|
|
--
|
|
|
|
|
2.25.1
|
|
|
|
|
|