1 Star 0 Fork 44

yueguofeng/rdma-core

forked from src-openEuler/rdma-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0029-libhns-Fix-ext_sge-page-size.patch 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ygf_123/rdma-core.git
git@gitee.com:ygf_123/rdma-core.git
ygf_123
rdma-core
rdma-core
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385