123 Star 0 Fork 23

src-openEuler/perftest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0014-Perftest-Fix-failure-in-creating-cq-when-create-cq-e.patch 2.25 KB
一键复制 编辑 原始数据 按行查看 历史
From 3ea6ea2490eb19e5951201804ab9df525338c799 Mon Sep 17 00:00:00 2001
From: Ge Hu <[email protected]>
Date: Mon, 2 Sep 2024 19:43:09 +0800
Subject: [PATCH] Perftest: Fix failure in creating cq when create cq ex is not
supported by providers
The previous TD lock-free patch introduced ibv_create_cq_ex() to
perftest, but it breaks the provider devices which do not support
this API yet. For these devices calling this API leads to an errno
of EOPNOTSUPP. So add a check of errno, and if it is EOPNOTSUPP,
use ibv_create_cq() as a fallback.
Fixes: b6f957f6bc6c ("Perftest: Add support for TD lock-free mode")
Tested-By: Selvin Xavier <[email protected]>
Signed-off-by: Junxian Huang <[email protected]>
Signed-off-by: Xinghai Cen <[email protected]>
---
src/perftest_resources.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index 58dbdef..843c45f 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -1516,7 +1516,7 @@ int create_reg_cqs(struct pingpong_context *ctx,
struct perftest_parameters *user_param,
int tx_buffer_depth, int need_recv_cq)
{
- #ifdef HAVE_CQ_EX
+#ifdef HAVE_CQ_EX
struct ibv_cq_init_attr_ex send_cq_attr = {
.cqe = tx_buffer_depth * user_param->num_of_qps,
.cq_context = NULL,
@@ -1532,6 +1532,8 @@ int create_reg_cqs(struct pingpong_context *ctx,
#endif
ctx->send_cq = ibv_cq_ex_to_cq(ibv_create_cq_ex(ctx->context, &send_cq_attr));
if (!ctx->send_cq) {
+ if (!user_param->no_lock && errno == EOPNOTSUPP)
+ goto cq_ex_not_supported;
fprintf(stderr, "Couldn't create CQ\n");
return FAILURE;
}
@@ -1556,7 +1558,9 @@ int create_reg_cqs(struct pingpong_context *ctx,
}
}
return SUCCESS;
-#else
+
+cq_ex_not_supported:
+#endif
ctx->send_cq = ibv_create_cq(ctx->context,tx_buffer_depth *
user_param->num_of_qps, NULL, ctx->channel, user_param->eq_num);
if (!ctx->send_cq) {
@@ -1574,7 +1578,6 @@ int create_reg_cqs(struct pingpong_context *ctx,
}
return SUCCESS;
-#endif
}
/******************************************************************************
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/perftest.git
[email protected]:src-openeuler/perftest.git
src-openeuler
perftest
perftest
master

搜索帮助