1 Star 0 Fork 46

zhangwenlong01/rdma-core

forked from src-openEuler/rdma-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0006-libhns-Add-compatibility-handling-for-rq-inline.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
From 996bca51e2063dc790286cbc894e2c438f499441 Mon Sep 17 00:00:00 2001
From: Luoyouming <luoyouming@huawei.com>
Date: Mon, 10 Oct 2022 21:49:35 +0800
Subject: [PATCH v4 06/10] libhns: Add compatibility handling for rq inline
Add compatibility processing between different user space
and kernel space.
Signed-off-by: Luoyouming <luoyouming@huawei.com>
Reviewed-by: Yangyang Li <liyangyang20@huawei.com>
---
providers/hns/hns_roce_u.c | 2 +-
providers/hns/hns_roce_u_verbs.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c
index 1bd5bb1..6c9aefa 100644
--- a/providers/hns/hns_roce_u.c
+++ b/providers/hns/hns_roce_u.c
@@ -113,7 +113,7 @@ static struct verbs_context *hns_roce_alloc_context(struct ibv_device *ibdev,
if (!context)
return NULL;
- cmd.config |= HNS_ROCE_EXSGE_FLAGS;
+ cmd.config |= HNS_ROCE_EXSGE_FLAGS | HNS_ROCE_RQ_INLINE_FLAGS;
if (ibv_cmd_get_context(&context->ibv_ctx, &cmd.ibv_cmd, sizeof(cmd),
&resp.ibv_resp, sizeof(resp)))
goto err_free;
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
index 851b145..3e9a306 100644
--- a/providers/hns/hns_roce_u_verbs.c
+++ b/providers/hns/hns_roce_u_verbs.c
@@ -1079,7 +1079,9 @@ static void hns_roce_set_qp_params(struct ibv_qp_init_attr_ex *attr,
cnt = roundup_pow_of_two(attr->cap.max_recv_wr);
qp->rq.wqe_cnt = cnt;
qp->rq.shift = hr_ilog32(cnt);
- qp->rq_rinl_buf.wqe_cnt = cnt;
+ qp->rq_rinl_buf.wqe_cnt = 0;
+ if (ctx->config & HNS_ROCE_RSP_RQ_INLINE_FLAGS)
+ qp->rq_rinl_buf.wqe_cnt = cnt;
attr->cap.max_recv_wr = qp->rq.wqe_cnt;
attr->cap.max_recv_sge = qp->rq.max_gs;
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangwenlong01/rdma-core.git
git@gitee.com:zhangwenlong01/rdma-core.git
zhangwenlong01
rdma-core
rdma-core
master

搜索帮助