1 Star 0 Fork 44

Lostway/rdma-core

forked from src-openEuler/rdma-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-libhns-Fix-ext_sge-num-error-when-post-send.patch 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
From a57d5dfbc2701b9d0c47eb70a1bb82b16170a7d2 Mon Sep 17 00:00:00 2001
From: Luoyouming <luoyouming@huawei.com>
Date: Tue, 20 Sep 2022 11:53:18 +0800
Subject: [PATCH v4 02/10] libhns: Fix ext_sge num error when post send
The max_gs is the sum of extended sge and standard sge. In function
fill_ext_sge_inl_data, max_gs does not subtract the number of extended
sges, but is directly used to calculate the size of extended sges.
Fixes:b7814b7b9715("libhns: Support inline data in extented sge space for RC")
Signed-off-by: Luoyouming <luoyouming@huawei.com>
Reviewed-by: Yangyang Li <liyangyang20@huawei.com>
---
providers/hns/hns_roce_u_hw_v2.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index d9ea18e..bb4298f 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -841,6 +841,14 @@ static void get_src_buf_info(void **src_addr, uint32_t *src_len,
}
}
+static unsigned int get_std_sge_num(struct hns_roce_qp *qp)
+{
+ if (qp->verbs_qp.qp.qp_type == IBV_QPT_UD)
+ return 0;
+
+ return HNS_ROCE_SGE_IN_WQE;
+}
+
static int fill_ext_sge_inl_data(struct hns_roce_qp *qp,
struct hns_roce_sge_info *sge_info,
const void *buf_list,
@@ -850,9 +858,12 @@ static int fill_ext_sge_inl_data(struct hns_roce_qp *qp,
unsigned int sge_mask = qp->ex_sge.sge_cnt - 1;
void *dst_addr, *src_addr, *tail_bound_addr;
uint32_t src_len, tail_len;
+ unsigned int std_sge_num;
int i;
- if (sge_info->total_len > qp->sq.max_gs * HNS_ROCE_SGE_SIZE)
+ std_sge_num = get_std_sge_num(qp);
+ if (sge_info->total_len >
+ (qp->sq.max_gs - std_sge_num) * HNS_ROCE_SGE_SIZE)
return EINVAL;
dst_addr = get_send_sge_ex(qp, sge_info->start_idx & sge_mask);
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Lostwayzxc/rdma-core.git
git@gitee.com:Lostwayzxc/rdma-core.git
Lostwayzxc
rdma-core
rdma-core
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385