perftest/0013-Perftest-Fix-TD-lock-free-mode-not-working-for-QP.patch
Xinghai Cen 9a7735ee77 Perftest: Fix failure in creating cq when create cq ex is not
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: b6f957f ("Perftest: Add support for TD lock-free mode")
(cherry picked from commit c6e2261f2d5be0856a7e2be14ae794a0ef8649df)
2024-09-06 12:54:19 +08:00

35 lines
1.2 KiB
Diff

From f8f97b189e9af6cff8559b10c749ff289219b754 Mon Sep 17 00:00:00 2001
From: Xinghai Cen <cenxinghai@h-partners.com>
Date: Wed, 21 Aug 2024 20:06:50 +0800
Subject: [PATCH] Perftest: Fix TD lock-free mode not working for QP
Fix TD lock-free mode not working for QP When
creating QP in TD lock-free mode, set attr_ex.pd with ctx->pad instead of
ctx->pd, otherwise the lock-free won't work.
Fixes: "Perftest: Add support for TD lock-free mode"
Signed-off-by: Guofeng Yue <yueguofeng@h-partners.com>
---
src/perftest_resources.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index 0e2b9a3..1bdf34e 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -2309,7 +2309,11 @@ struct ibv_qp* ctx_qp_create(struct pingpong_context *ctx,
else if (opcode == IBV_WR_RDMA_READ)
attr_ex.send_ops_flags |= IBV_QP_EX_WITH_RDMA_READ;
}
+ #ifdef HAVE_TD_API
+ attr_ex.pd = user_param->no_lock ? ctx->pad : ctx->pd;
+ #else
attr_ex.pd = ctx->pd;
+ #endif
attr_ex.comp_mask |= IBV_QP_INIT_ATTR_SEND_OPS_FLAGS | IBV_QP_INIT_ATTR_PD;
attr_ex.send_cq = attr.send_cq;
attr_ex.recv_cq = attr.recv_cq;
--
2.25.1