代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rdma-core 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 85b6e60f3ec97d2479373111b2a4bceb6ef286cd Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Fri, 19 Apr 2024 12:06:12 +0800
Subject: [PATCH] libhns: Fix ext_sge page size
driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I98HIN
--------------------------------------------------------------------------
The buffer for extending SGE must be equal to the WQE buffer page
size.
Fixes: bf57963e729c ("libhns: Support flexible WQE buffer page size")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
providers/hns/hns_roce_u_verbs.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
index 8964d53..a680339 100644
--- a/providers/hns/hns_roce_u_verbs.c
+++ b/providers/hns/hns_roce_u_verbs.c
@@ -1270,8 +1270,10 @@ static void get_best_multi_region_pg_shift(struct hns_roce_device *hr_dev,
/*
* The larger the pagesize used, the better the performance, but it
* may waste more memory. Therefore, we use the least common multiple
- * (aligned to power of 2) of sq wqe buffer size, rq wqe buffer size,
* and ext_sge buffer size as the pagesize. Additionally, since the
+ * (aligned to power of 2) of sq wqe buffer size and rq wqe buffer
+ * size as the pagesize. And the wqe buffer page cannot be larger
+ * than the buffer size used by extend sge. Additionally, since the
* kernel cannot guarantee the allocation of contiguous memory larger
* than the system page, the pagesize must be smaller than the system
* page.
@@ -1281,8 +1283,10 @@ static void get_best_multi_region_pg_shift(struct hns_roce_device *hr_dev,
rq_size = qp->rq.wqe_cnt << qp->rq.wqe_shift;
pg_shift = max_t(uint8_t, sq_size ? hr_ilog32(sq_size) : 0,
- ext_sge_size ? hr_ilog32(ext_sge_size) : 0);
- pg_shift = max_t(uint8_t, pg_shift, rq_size ? hr_ilog32(rq_size) : 0);
+ rq_size ? hr_ilog32(rq_size) : 0);
+ pg_shift = ext_sge_size ?
+ min_t(uint8_t, pg_shift, hr_ilog32(ext_sge_size)) :
+ pg_shift;
pg_shift = max_t(uint8_t, pg_shift, HNS_HW_PAGE_SHIFT);
qp->pageshift = min_t(uint8_t, pg_shift, hr_ilog32(hr_dev->page_size));
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。