Skip to content

Commit

Permalink
librdmacm/cmtime: Add option to control number of threads
Browse files Browse the repository at this point in the history
Add a command line argument to set the number of threads
assigned to a work queue.

Signed-off-by: Sean Hefty <[email protected]>
  • Loading branch information
Sean Hefty committed Apr 23, 2024
1 parent 78a4f91 commit 79ab39a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion librdmacm/examples/cmtime.c
Expand Up @@ -763,7 +763,7 @@ int main(int argc, char **argv)

hints.ai_port_space = RDMA_PS_TCP;
hints.ai_qp_type = IBV_QPT_RC;
while ((op = getopt(argc, argv, "s:b:c:m:p:q:r:t:")) != -1) {
while ((op = getopt(argc, argv, "s:b:c:m:n:p:q:r:t:")) != -1) {
switch (op) {
case 's':
dst_addr = optarg;
Expand All @@ -784,6 +784,9 @@ int main(int argc, char **argv)
mimic_qp_delay = (uint32_t) atoi(optarg);
mimic = true;
break;
case 'n':
num_threads = (uint32_t) atoi(optarg);
break;
case 'r':
retries = atoi(optarg);
break;
Expand All @@ -798,6 +801,7 @@ int main(int argc, char **argv)
printf("\t[-p port_number]\n");
printf("\t[-q base_qpn]\n");
printf("\t[-m mimic_qp_delay_us]\n");
printf("\t[-n num_threads]\n");
printf("\t[-r retries]\n");
printf("\t[-t timeout_ms]\n");
exit(EXIT_FAILURE);
Expand Down
5 changes: 5 additions & 0 deletions librdmacm/man/cmtime.1
Expand Up @@ -57,6 +57,11 @@ The server's port number.
The first QP number to use when creating connections without allocating
hardware QPs. The test will use the values between base_qpn and base_qpn
plus connections when connecting. (default 1000)
.TP
\-n num_threads
Sets the number of threads to spawn used to process connection events
and hardware operations. (default 1)
.TP
\-m mimic_qp_delay_us
"Simulates" QP creation and modify calls by replacing them with a
simple sleep function instead. This allows testing the CM at larger
Expand Down

0 comments on commit 79ab39a

Please sign in to comment.