Skip to content

Commit 8867689

Browse files
Junxian Huangsshaulnv
authored andcommitted
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: 4c774a9 ("Added XRC for ib_send_bw test") Signed-off-by: Junxian Huang <[email protected]>
1 parent 7c282ef commit 8867689

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/perftest_parameters.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,19 @@ static void force_dependecies(struct perftest_parameters *user_param)
11241124
exit (1);
11251125
}
11261126

1127-
if (user_param->use_srq && user_param->num_of_qps > user_param->rx_depth) {
1127+
/* XRC Part */
1128+
if (user_param->connection_type == XRC) {
1129+
if (user_param->work_rdma_cm == ON) {
1130+
printf(RESULT_LINE);
1131+
fprintf(stderr," XRC does not support RDMA_CM\n");
1132+
exit(1);
1133+
}
1134+
user_param->use_xrc = ON;
1135+
user_param->use_srq = ON;
1136+
}
1137+
1138+
if (user_param->use_srq && user_param->verb == SEND &&
1139+
user_param->num_of_qps > user_param->rx_depth) {
11281140
printf(RESULT_LINE);
11291141
printf(" Using SRQ depth should be greater than number of QPs.\n");
11301142
exit (1);
@@ -1419,17 +1431,6 @@ static void force_dependecies(struct perftest_parameters *user_param)
14191431
if (user_param->connection_type == DC && !user_param->use_srq)
14201432
user_param->use_srq = ON;
14211433

1422-
/* XRC Part */
1423-
if (user_param->connection_type == XRC) {
1424-
if (user_param->work_rdma_cm == ON) {
1425-
printf(RESULT_LINE);
1426-
fprintf(stderr," XRC does not support RDMA_CM\n");
1427-
exit(1);
1428-
}
1429-
user_param->use_xrc = ON;
1430-
user_param->use_srq = ON;
1431-
}
1432-
14331434
if (!user_param->use_old_post_send)
14341435
{
14351436
#ifndef HAVE_IBV_WR_API

0 commit comments

Comments
 (0)