1 Star 0 Fork 23

zhangwenlong01/perftest

forked from src-openEuler/perftest 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-Perftest-Fix-verification-of-max_inline_data-for-_cr.patch 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
tcc@hello 提交于 2022-11-22 23:52 . Replace patches with community version
From 1a842d207a981c72c5162f4efd89da8c5a07a772 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Tue, 8 Nov 2022 20:20:40 +0800
Subject: Perftest: Fix verification of max_inline_data for *_create_qp_ex()
Currently, attr.cap.max_inline_data is used for validation in
*_create_qp() and *_create_qp_ex(). But actually, when entering
the create_qp_ex path, the variable attr is not used. So the current
check of the *_create_qp_ex() branch is meaningless.
The attr_ex.cap.max_inline_data is used to check the max_inline_data
in *_create_qp_ex() path. And related printing error has also been
fixed.
Fixes: 13f71777e6f0 ("Added new post_send API usage for RC,UC,UD,XRC")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
src/perftest_resources.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index 23c31d1..751ea96 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -2138,22 +2138,21 @@ struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx,
int dc_num_of_qps = user_param->num_of_qps / 2;
int is_dc_server_side = 0;
+ struct ibv_qp_init_attr attr;
+ memset(&attr, 0, sizeof(struct ibv_qp_init_attr));
+ struct ibv_qp_cap *qp_cap = &attr.cap;
+
#ifdef HAVE_IBV_WR_API
enum ibv_wr_opcode opcode;
- struct ibv_qp_init_attr attr;
struct ibv_qp_init_attr_ex attr_ex;
+ memset(&attr_ex, 0, sizeof(struct ibv_qp_init_attr_ex));
#ifdef HAVE_MLX5DV
struct mlx5dv_qp_init_attr attr_dv;
memset(&attr_dv, 0, sizeof(attr_dv));
#endif
- memset(&attr, 0, sizeof(struct ibv_qp_init_attr));
- memset(&attr_ex, 0, sizeof(struct ibv_qp_init_attr_ex));
#ifdef HAVE_SRD
struct efadv_qp_init_attr efa_attr = {};
#endif
- #else
- struct ibv_qp_init_attr attr;
- memset(&attr, 0, sizeof(struct ibv_qp_init_attr));
#endif
attr.send_cq = ctx->send_cq;
@@ -2328,10 +2327,15 @@ struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx,
fprintf(stderr, "Current TX depth is %d and inline size is %d .\n", user_param->tx_depth, user_param->inline_size);
}
- if (user_param->inline_size > attr.cap.max_inline_data) {
- user_param->inline_size = attr.cap.max_inline_data;
- printf(" Actual inline-size(%d) > requested inline-size(%d)\n",
- attr.cap.max_inline_data, user_param->inline_size);
+ #ifdef HAVE_IBV_WR_API
+ if (!user_param->use_old_post_send)
+ qp_cap = &attr_ex.cap;
+ #endif
+
+ if (user_param->inline_size > qp_cap->max_inline_data) {
+ printf(" Actual inline-size(%d) < requested inline-size(%d)\n",
+ qp_cap->max_inline_data, user_param->inline_size);
+ user_param->inline_size = qp_cap->max_inline_data;
}
return qp;
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangwenlong01/perftest.git
git@gitee.com:zhangwenlong01/perftest.git
zhangwenlong01
perftest
perftest
master

搜索帮助