From: Xinghai Cen cenxinghai@h-partners.com
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.
update perftest.spec.
Signed-off-by:Xinghai Cen cenxinghai@partners.com --- ...-Perftest-Fix-rx_depth-check-for-XRC.patch | 71 +++++++++++++++++++ perftest.spec | 9 ++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 0011-Perftest-Fix-rx_depth-check-for-XRC.patch
diff --git a/0011-Perftest-Fix-rx_depth-check-for-XRC.patch b/0011-Perftest-Fix-rx_depth-check-for-XRC.patch new file mode 100644 index 0000000..270eab7 --- /dev/null +++ b/0011-Perftest-Fix-rx_depth-check-for-XRC.patch @@ -0,0 +1,71 @@ +From 64aa45969c82936f531ede3d460e797acba5a77a 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 034a20e..c15fc45 100755 +--- a/src/perftest_parameters.c ++++ b/src/perftest_parameters.c +@@ -1070,7 +1070,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); +@@ -1368,17 +1380,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.33.0 + diff --git a/perftest.spec b/perftest.spec index c34a50b..a47c99f 100644 --- a/perftest.spec +++ b/perftest.spec @@ -1,6 +1,6 @@ Name: perftest Version: 4.5 -Release: 7 +Release: 8 License: GPLv2 or BSD Summary: RDMA Performance Testing Tools 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 Patch9: 0009-Get-CPU-cycles-on-RISC-V.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: pciutils-devel libibverbs librdmacm libibumad @@ -42,6 +43,12 @@ done %_bindir/*
%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 - Type: feature - ID: NA