driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IALOAP ---------------------------------------------------------------------- Fixes several bugs for hns: libhns: Fix overwritten SL in DSCP mode libhns: Support returning the final value of SL configuration libhns: Fix memory leakage when DCA is enabled libhns: Fix the exception branch of wr_start() is not locked Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com> (cherry picked from commit f7e92a7c61500e17a864d2e016e842436bd1f442)
35 lines
1.0 KiB
Diff
35 lines
1.0 KiB
Diff
From 485a60f8850630c37856f68be3fbf37bfa9ac019 Mon Sep 17 00:00:00 2001
|
|
From: wenglianfa <wenglianfa@huawei.com>
|
|
Date: Thu, 25 Jul 2024 11:06:01 +0800
|
|
Subject: [PATCH 3/4] libhns: Fix memory leakage when DCA is enabled
|
|
|
|
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: 3aa4683ef700 ("libhns: Add support for attaching QP's WQE buffer")
|
|
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
|
|
---
|
|
providers/hns/hns_roce_u_verbs.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
|
|
index 090efbf..dae8298 100644
|
|
--- a/providers/hns/hns_roce_u_verbs.c
|
|
+++ b/providers/hns/hns_roce_u_verbs.c
|
|
@@ -1617,7 +1617,10 @@ static void qp_free_wqe(struct hns_roce_qp *qp)
|
|
|
|
if (qp->rq.wqe_cnt)
|
|
free(qp->rq.wrid);
|
|
- hns_roce_free_buf(&qp->buf);
|
|
+ if (qp->dca_wqe.bufs)
|
|
+ free(qp->dca_wqe.bufs);
|
|
+ else
|
|
+ hns_roce_free_buf(&qp->buf);
|
|
}
|
|
|
|
static int qp_alloc_wqe(struct ibv_qp_init_attr_ex *attr,
|
|
--
|
|
2.33.0
|
|
|