16 Star 4 Fork 51

src-openEuler/rdma-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0035-Fix-the-stride-calculation-for-MSN-PSN-area.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
dfh 提交于 2024-07-17 10:40 +08:00 . Fix the stride calculation for MSN/PSN area
From 05b65d96296f07baca079acef1a5bbb3c71fffb6 Mon Sep 17 00:00:00 2001
From: Selvin Xavier <selvin.xavier@broadcom.com>
Date: Wed, 17 Jul 2024 10:34:23 +0800
Subject: [PATCH] Fix the stride calculation for MSN/PSN area [ Upstream commit
65197a4 ] Library expects ilog2 of psn_size while calculating the stride.
ilog32 returns log2(v) + 1 and the calculation fails since the psn size is a
power of 2 value. Fix by passing psn_size - 1.
Fixes: 0a0e0d0 ("bnxt_re/lib: Adds MSN table capability for Gen P7 adapters")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
---
providers/bnxt_re/verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index 55d5284..a74d32c 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -1233,7 +1233,7 @@ static int bnxt_re_alloc_queues(struct bnxt_re_context *cntx,
/* psn_depth extra entries of size que->stride */
psn_size = bnxt_re_get_psne_size(qp->cntx);
psn_depth = (nswr * psn_size) / que->stride;
- que->pad_stride_log2 = (uint32_t)ilog32(psn_size);
+ que->pad_stride_log2 = ilog32(psn_size - 1);
if ((nswr * psn_size) % que->stride)
psn_depth++;
que->depth += psn_depth;
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rdma-core.git
git@gitee.com:src-openeuler/rdma-core.git
src-openeuler
rdma-core
rdma-core
master

搜索帮助