Fix rx_depth check for XRC

When users manually specifies use_srq in perftest command, the rx_depth will
    be checked.
    If rx_depth is less than the number of qps, the process will throw an error
    and exit.
    Url:   https://github.com/linux-rdma/perftest/commit/lc358f240129f686ebd616a8b2a75f1561846c6c

Signed-off-by:Xinghai Cen <cenxinghai@partners.com>
(cherry picked from commit 662ad4a698723579fb79aaf6a341040bfbefeac1)
This commit is contained in:
Guofeng Yue 2024-07-11 10:16:22 +08:00 committed by openeuler-sync-bot
parent 80ec12cac3
commit f00efe5824
2 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,71 @@
From c642cd2753b1b9343a5642ffeaaa78ef135f0f6e Mon Sep 17 00:00:00 2001
From: Junxian Huang <huangjunxian6@hisilicon.com>
Date: Fri, 24 May 2024 17:32:27 +0800
Subject: [PATCH] Perftest: Fix rx_depth check for XRC
When users manually specifies --use_srq in perftest command, the rx_depth
will be checked. If rx_depth is less than the number of qps, the process
will throw an error and exit.
For XRC SEND where SRQ is definitely used, users normally don't need to
manually specifies --use_srq, since the use_srq flag will be set to on
when parsing the XRC parameters. However, the XRC parameters parsing is
after the SRQ rx_depth check. If rx_depth is less than the number of qps
in this case, it will miss the check, size_per_qp in ctx_set_recv_wqes()
will become 0 and ibv_post_srq_recv() won't be called.
Move the XRC parameters parsing ahead of SRQ rx_depth check and set
--use_srq to on in advance so that the rx_depth error can be thrown.
Fixes: 4c774a951b3c ("Added XRC for ib_send_bw test")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
---
src/perftest_parameters.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/perftest_parameters.c b/src/perftest_parameters.c
index 5d27132..52b21dc 100755
--- a/src/perftest_parameters.c
+++ b/src/perftest_parameters.c
@@ -1098,7 +1098,19 @@ static void force_dependecies(struct perftest_parameters *user_param)
exit (1);
}
- if (user_param->use_srq && user_param->num_of_qps > user_param->rx_depth) {
+ /* XRC Part */
+ if (user_param->connection_type == XRC) {
+ if (user_param->work_rdma_cm == ON) {
+ printf(RESULT_LINE);
+ fprintf(stderr," XRC does not support RDMA_CM\n");
+ exit(1);
+ }
+ user_param->use_xrc = ON;
+ user_param->use_srq = ON;
+ }
+
+ if (user_param->use_srq && user_param->verb == SEND &&
+ user_param->num_of_qps > user_param->rx_depth) {
printf(RESULT_LINE);
printf(" Using SRQ depth should be greater than number of QPs.\n");
exit (1);
@@ -1396,17 +1408,6 @@ static void force_dependecies(struct perftest_parameters *user_param)
if (user_param->connection_type == DC && !user_param->use_srq)
user_param->use_srq = ON;
- /* XRC Part */
- if (user_param->connection_type == XRC) {
- if (user_param->work_rdma_cm == ON) {
- printf(RESULT_LINE);
- fprintf(stderr," XRC does not support RDMA_CM\n");
- exit(1);
- }
- user_param->use_xrc = ON;
- user_param->use_srq = ON;
- }
-
if (!user_param->use_old_post_send)
{
#ifndef HAVE_IBV_WR_API
--
2.25.1

View File

@ -1,6 +1,6 @@
Name: perftest Name: perftest
Version: 4.5 Version: 4.5
Release: 7 Release: 8
License: GPLv2 or BSD License: GPLv2 or BSD
Summary: RDMA Performance Testing Tools Summary: RDMA Performance Testing Tools
Url: https://github.com/linux-rdma/perftest Url: https://github.com/linux-rdma/perftest
@ -16,6 +16,7 @@ Patch7: 0007-add-loongarch-support-for-perftest.patch
Patch8: 0008-Get-CPU-MHz-on-RISC-V.patch Patch8: 0008-Get-CPU-MHz-on-RISC-V.patch
Patch9: 0009-Get-CPU-cycles-on-RISC-V.patch Patch9: 0009-Get-CPU-cycles-on-RISC-V.patch
Patch10: 0010-Perftest-Support-selecting-congestion-control-algori.patch Patch10: 0010-Perftest-Support-selecting-congestion-control-algori.patch
Patch11: 0011-Perftest-Fix-rx_depth-check-for-XRC.patch
BuildRequires: automake gcc libibverbs-devel >= 1.2.0 librdmacm-devel >= 1.0.21 libibumad-devel >= 1.3.10.2 BuildRequires: automake gcc libibverbs-devel >= 1.2.0 librdmacm-devel >= 1.0.21 libibumad-devel >= 1.3.10.2
BuildRequires: pciutils-devel libibverbs librdmacm libibumad BuildRequires: pciutils-devel libibverbs librdmacm libibumad
@ -42,6 +43,12 @@ done
%_bindir/* %_bindir/*
%changelog %changelog
* Mon Jul 8 2024 Xinghai Cen <cenxinghai@h-partners.com> - 4.5-8
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: fix rx_depth check for XRC
* Mon Jul 8 2024 Xinghai Cen <cenxinghai@h-partners.com> - 4.5-7 * Mon Jul 8 2024 Xinghai Cen <cenxinghai@h-partners.com> - 4.5-7
- Type: feature - Type: feature
- ID: NA - ID: NA