Skip to content

Commit bee05d3

Browse files
author
Johann George
committed
Added support for XRC, fixed bugs
1 parent b41f827 commit bee05d3

File tree

10 files changed

+650
-238
lines changed

10 files changed

+650
-238
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Thanks to the following for their contributions:
44
Dotan Barak
55
Ralph Campbell
66
Yevgeny Kliteynik
7+
Dave Olson

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
AC_INIT(qperf, 0.4.1, [email protected])
2-
AM_INIT_AUTOMAKE(qperf, 0.4.1)
1+
AC_INIT(qperf, 0.4.2, [email protected])
2+
AM_INIT_AUTOMAKE(qperf, 0.4.2)
33
AC_PROG_CC
44
AC_CHECK_LIB(ibverbs, ibv_open_device, RDMA=1)
55
AC_CHECK_LIB(rdmacm, rdma_create_id)

qperf.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: qperf
22
Summary: Measure socket and RDMA performance
3-
Version: 0.4.1
3+
Version: 0.4.2
44
Release: 1
55
License: BSD 3-Clause, GPL v2
66
Group: Networking/Diagnostic

src/help.txt

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ Categories +RDMA
9494
udp_lat
9595
ver_rc_compare_swap
9696
ver_rc_fetch_add
97+
xrc_bi_bw
98+
xrc_bw
99+
xrc_lat
97100
Examples
98101
In these examples, we first run qperf on a node called myserver in server
99102
mode by invoking it with no arguments. In all the subsequent examples, we
@@ -111,12 +114,15 @@ Examples
111114
qperf myserver rc_bi_bw
112115
Opts
113116
--access_recv OnOff (-ar) Turn on/off accessing received data
114-
-aro Cause received data to be accessed
117+
-ar1 Cause received data to be accessed
118+
--alt_port Port (-ap) Set alternate path port
119+
--loc_alt_port Port (-lap) Set local alternate path port
120+
--rem_alt_port Port (-rap) Set remote alternate path port
115121
--cpu_affinity PN (-ca) Set processor affinity
116122
--loc_cpu_affinity PN (-lca) Set local processor affinity
117123
--rem_cpu_affinity PN (-rca) Set remote processor affinity
118124
--flip OnOff (-f) Flip on/off sender and receiver
119-
-fo Flip (on) sender and receiver
125+
-f1 Flip (on) sender and receiver
120126
--help Topic (-h) Get more information on a topic
121127
--host Node (-H) Identify server node
122128
--id Device:Port (-i) Set RDMA device and port
@@ -129,9 +135,9 @@ Opts
129135
--cq_poll OnOff Set polling mode on/off
130136
--loc_cq_poll OnOff (-lcp) Set local polling mode on/off
131137
--rem_cq_poll OnOff (-rcp) Set remote polling mode on/off
132-
-cpo Turn polling mode on
133-
-lcpo Turn local polling mode on
134-
-rcpo Turn remote polling mode on
138+
-cp1 Turn polling mode on
139+
-lcp1 Turn local polling mode on
140+
-rcp1 Turn remote polling mode on
135141
--ip_port Port (-ip) Set TCP port used for tests
136142
--precision Digits (-e) Set precision reported
137143
--rd_atomic Max (-nr) Set RDMA read/atomic count
@@ -154,7 +160,7 @@ Opts
154160
--unify_units (-uu) Unify units
155161
--use_bits_per_sec (-ub) Use bits/sec rather than bytes/sec
156162
--use_cm OnOff (-cm) Use RDMA Connection Manager or not
157-
-cmo Use RDMA Connection Manager
163+
-cm1 Use RDMA Connection Manager
158164
--verbose (-v) Verbose; turn on all of -v[cstu]
159165
--verbose_conf (-vc) Show configuration information
160166
--verbose_stat (-vs) Show statistical information
@@ -172,8 +178,14 @@ Options
172178
If OnOff is non-zero, data is accessed once received. Otherwise,
173179
data is ignored. By default, OnOff is 0. This can help to mimic
174180
some applications.
175-
-aro
181+
-ar1
176182
Cause received data to be accessed.
183+
--alt_port Port (-ap)
184+
Set alternate path port. This enables automatic path failover.
185+
--loc_alt_port Port (-lap)
186+
Set local alternate path port. This enables automatic path failover.
187+
--rem_alt_port Port (-rap)
188+
Set remote alternate path port. This enables automatic path failover.
177189
--cpu_affinity PN (-ca)
178190
Set cpu affinity to PN. CPUs are numbered sequentially from 0. If
179191
PN is "any", any cpu is allowed otherwise the cpu is limited to the
@@ -184,7 +196,7 @@ Options
184196
Set remote processor affinity to PN.
185197
--flip OnOff (-f)
186198
If non-zero, cause sender and receiver to play opposite roles.
187-
-fo
199+
-f1
188200
Cause sender and receiver to play opposite roles.
189201
--help Topic (-h)
190202
Print out information about Topic. To see the list of topics, type
@@ -222,11 +234,11 @@ Options
222234
Locally turn polling mode on or off.
223235
--rem_cq_poll OnOff (-rcp)
224236
Remotely turn polling mode on or off.
225-
-cpo
237+
-cp1
226238
Turn polling mode on.
227-
-lcpo
239+
-lcp1
228240
Turn local polling mode on.
229-
-rcpo
241+
-rcp1
230242
Turn remote polling mode on.
231243
--ip_port Port (-ip)
232244
Use Port to run the socket tests. This is different from
@@ -294,7 +306,7 @@ Options
294306
necessary to use the CM for iWARP devices. The default is to
295307
establish the connection without using the CM. This only works for
296308
the tests that use the RC transport.
297-
-cmo
309+
-cm1
298310
Use RDMA Connection Manager.
299311
--verbose (-v)
300312
Provide more detailed output. Turns on -vc, -vs, -vt and -vu.
@@ -894,3 +906,52 @@ ver_rc_fetch_add +RDMA
894906
Tests the RC Fetch and Add Atomic operation. The server's memory
895907
location starts with zero and the client successively adds one. The
896908
results are checked for correctness.
909+
xrc_bw +RDMA
910+
Purpose
911+
XRC streaming one way bandwidth
912+
Common Options
913+
--access_recv OnOff (-ar) Access received data
914+
--id Device:Port (-i) Set RDMA device and port
915+
--msg_size Size (-m) Set message size
916+
--cq_poll OnOff Set polling mode on/off
917+
--time (-t) Set test duration
918+
Other Options
919+
--cpu_affinity, --listen_port, --mtu_size, --static_rate, --timeout
920+
Display Options
921+
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
922+
--verbose
923+
Description
924+
The client sends messages to the server who notes how many it received.
925+
The XRC Send/Receive mechanism is used.
926+
xrc_bi_bw +RDMA
927+
Purpose
928+
XRC streaming two way bandwidth
929+
Common Options
930+
--access_recv OnOff (-ar) Access received data
931+
--id Device:Port (-i) Set RDMA device and port
932+
--msg_size Size (-m) Set message size
933+
--cq_poll OnOff Set polling mode on/off
934+
--time (-t) Set test duration
935+
Other Options
936+
--cpu_affinity, --listen_port, --mtu_size, --static_rate, --timeout
937+
Display Options
938+
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
939+
--verbose
940+
Description
941+
Both the client and server exchange messages with each other using the
942+
XRC Send/Receive mechanism and note how many were received.
943+
xrc_lat +RDMA
944+
Purpose
945+
XRC one way latency
946+
Common Options
947+
--id Device:Port (-i) Set RDMA device and port
948+
--msg_size Size (-m) Set message size
949+
--cq_poll OnOff Set polling mode on/off
950+
--time (-t) Set test duration
951+
Other Options
952+
--cpu_affinity, --listen_port, --mtu_size, --static_rate, --timeout
953+
Display Options
954+
--precision, --unify_nodes, --unify_units, --verbose
955+
Description
956+
A ping pong latency test where the server and client exchange messages
957+
repeatedly using XRC Send/Receive.

src/qperf.c

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
*/
6363
#define VER_MAJ 0 /* Major version */
6464
#define VER_MIN 4 /* Minor version */
65-
#define VER_INC 1 /* Incremental version */
65+
#define VER_INC 2 /* Incremental version */
6666
#define LISTENQ 5 /* Size of listen queue */
6767
#define BUFSIZE 1024 /* Size of buffers */
6868

@@ -273,6 +273,7 @@ volatile int Finished;
273273
PAR_NAME ParName[] ={
274274
{ "access_recv", L_ACCESS_RECV, R_ACCESS_RECV },
275275
{ "affinity", L_AFFINITY, R_AFFINITY },
276+
{ "alt_port", L_ALT_PORT, R_ALT_PORT },
276277
{ "flip", L_FLIP, R_FLIP },
277278
{ "id", L_ID, R_ID },
278279
{ "msg_size", L_MSG_SIZE, R_MSG_SIZE },
@@ -299,6 +300,8 @@ PAR_INFO ParInfo[P_N] ={
299300
{ R_ACCESS_RECV, 'l', &RReq.access_recv },
300301
{ L_AFFINITY, 'l', &Req.affinity },
301302
{ R_AFFINITY, 'l', &RReq.affinity },
303+
{ L_ALT_PORT, 'l', &Req.alt_port },
304+
{ R_ALT_PORT, 'l', &RReq.alt_port },
302305
{ L_FLIP, 'l', &Req.flip },
303306
{ R_FLIP, 'l', &RReq.flip },
304307
{ L_ID, 'p', &Req.id },
@@ -378,6 +381,13 @@ DICT Renamed[] = {
378381
{ "-vS", "-vvs", },
379382
{ "-vT", "-vvt", },
380383
{ "-vU", "-vvu", },
384+
/* options that are on */
385+
{ "-aro", "-ar1" },
386+
{ "-cmo", "-cm1" },
387+
{ "-fo", "-f1" },
388+
{ "-cpo", "-cp1" },
389+
{ "-lcpo", "-lcp1" },
390+
{ "-rcpo", "-rcp1" },
381391
/* miscellaneous */
382392
{ "-Ar", "-ar" },
383393
{ "-M", "-mt" },
@@ -393,7 +403,13 @@ DICT Renamed[] = {
393403
OPTION Options[] ={
394404
{ "--access_recv", "int", L_ACCESS_RECV, R_ACCESS_RECV },
395405
{ "-ar", "int", L_ACCESS_RECV, R_ACCESS_RECV },
396-
{ "-aro", "set1", L_ACCESS_RECV, R_ACCESS_RECV },
406+
{ "-ar1", "set1", L_ACCESS_RECV, R_ACCESS_RECV },
407+
{ "--alt_port", "int", L_ALT_PORT, R_ALT_PORT },
408+
{ "-ap", "int", L_ALT_PORT, R_ALT_PORT },
409+
{ "--loc_alt_port", "int", L_ALT_PORT, },
410+
{ "-lap", "int", L_ALT_PORT, },
411+
{ "--rem_alt_port", "int", R_ALT_PORT },
412+
{ "-rap", "int", R_ALT_PORT },
397413
{ "--cpu_affinity", "int", L_AFFINITY, R_AFFINITY },
398414
{ "-ca", "int", L_AFFINITY, R_AFFINITY },
399415
{ "--loc_cpu_affinity", "int", L_AFFINITY, },
@@ -404,7 +420,7 @@ OPTION Options[] ={
404420
{ "-D", "Sdebug", },
405421
{ "--flip", "int", L_FLIP, R_FLIP },
406422
{ "-f", "int", L_FLIP, R_FLIP },
407-
{ "-fo", "set1", L_FLIP, R_FLIP },
423+
{ "-f1", "set1", L_FLIP, R_FLIP },
408424
{ "--help", "help" },
409425
{ "-h", "help" },
410426
{ "--host", "host", },
@@ -425,13 +441,13 @@ OPTION Options[] ={
425441
{ "-n", "int", L_NO_MSGS, R_NO_MSGS },
426442
{ "--cq_poll", "int", L_POLL_MODE, R_POLL_MODE },
427443
{ "-cp", "int", L_POLL_MODE, R_POLL_MODE },
428-
{ "-cpo", "set1", L_POLL_MODE, R_POLL_MODE },
444+
{ "-cp1", "set1", L_POLL_MODE, R_POLL_MODE },
429445
{ "--loc_cq_poll", "int", L_POLL_MODE, },
430446
{ "-lcp", "int", L_POLL_MODE, },
431-
{ "-lcpo", "set1", L_POLL_MODE },
447+
{ "-lcp1", "set1", L_POLL_MODE },
432448
{ "--rem_cq_poll", "int", R_POLL_MODE },
433449
{ "-rcp", "int", R_POLL_MODE },
434-
{ "-rcpo", "set1", R_POLL_MODE },
450+
{ "-rcp1", "set1", R_POLL_MODE },
435451
{ "--ip_port", "int", L_PORT, R_PORT },
436452
{ "-ip", "int", L_PORT, R_PORT },
437453
{ "--precision", "precision", },
@@ -476,7 +492,7 @@ OPTION Options[] ={
476492
{ "-ub", "ub", },
477493
{ "--use_cm", "int", L_USE_CM, R_USE_CM },
478494
{ "-cm", "int", L_USE_CM, R_USE_CM },
479-
{ "-cmo", "set1", L_USE_CM, R_USE_CM },
495+
{ "-cm1", "set1", L_USE_CM, R_USE_CM },
480496
{ "--verbose", "v", },
481497
{ "-v", "v", },
482498
{ "--verbose_conf", "vc", },
@@ -543,6 +559,9 @@ TEST Tests[] ={
543559
test(ud_lat),
544560
test(ver_rc_compare_swap),
545561
test(ver_rc_fetch_add),
562+
test(xrc_bi_bw),
563+
test(xrc_bw),
564+
test(xrc_lat),
546565
#endif
547566
};
548567

@@ -786,6 +805,7 @@ do_option(OPTION *option, char ***argvp)
786805
/* Help */
787806
char **usage;
788807
char *category = (*argvp)[1];
808+
789809
if (!category)
790810
category = "main";
791811
for (usage = Usage; *usage; usage += 2)
@@ -1137,7 +1157,7 @@ server(void)
11371157
TEST *test;
11381158
int s = offset(REQ, req_index);
11391159

1140-
debug("waiting for request");
1160+
debug("ready for requests");
11411161
if (!server_recv_request())
11421162
continue;
11431163
pid = fork();
@@ -1164,7 +1184,7 @@ server(void)
11641184

11651185
test = &Tests[Req.req_index];
11661186
TestName = test->name;
1167-
debug("request is %s", TestName);
1187+
debug("received request: %s", TestName);
11681188
init_lstat();
11691189
Finished = 0;
11701190
set_affinity();
@@ -1283,7 +1303,7 @@ client(TEST *test)
12831303
RReq.ver_inc = VER_INC;
12841304
RReq.req_index = test - Tests;
12851305
TestName = test->name;
1286-
debug("sending request %s", TestName);
1306+
debug("sending request: %s", TestName);
12871307
init_lstat();
12881308
printf("%s:\n", TestName);
12891309
Finished = 0;
@@ -1378,12 +1398,12 @@ exchange_results(void)
13781398
recv_mesg(&stat, sizeof(stat), "results");
13791399
dec_init(&stat);
13801400
dec_stat(&RStat);
1381-
send_sync("results");
1401+
send_sync("synchronization after test");
13821402
} else {
13831403
enc_init(&stat);
13841404
enc_stat(&LStat);
13851405
send_mesg(&stat, sizeof(stat), "results");
1386-
recv_sync("results");
1406+
recv_sync("synchronization after test");
13871407
}
13881408
}
13891409

@@ -1583,7 +1603,7 @@ run_server_quit(void)
15831603
void
15841604
sync_test(void)
15851605
{
1586-
synchronize("test");
1606+
synchronize("synchronization before test");
15871607
start_test_timer(Req.time);
15881608
}
15891609

@@ -1601,7 +1621,7 @@ start_test_timer(int seconds)
16011621
if (!seconds)
16021622
return;
16031623

1604-
debug("starting timer");
1624+
debug("starting timer for %d seconds", seconds);
16051625
itimerval.it_value.tv_sec = seconds;
16061626
itimerval.it_interval.tv_usec = 1;
16071627
setitimer(ITIMER_REAL, &itimerval, 0);
@@ -2422,6 +2442,7 @@ enc_req(REQ *host)
24222442
enc_int(host->req_index, sizeof(host->req_index));
24232443
enc_int(host->access_recv, sizeof(host->access_recv));
24242444
enc_int(host->affinity, sizeof(host->affinity));
2445+
enc_int(host->alt_port, sizeof(host->alt_port));
24252446
enc_int(host->flip, sizeof(host->flip));
24262447
enc_int(host->msg_size, sizeof(host->msg_size));
24272448
enc_int(host->mtu_size, sizeof(host->mtu_size));
@@ -2462,6 +2483,7 @@ dec_req_data(REQ *host)
24622483
host->req_index = dec_int(sizeof(host->req_index));
24632484
host->access_recv = dec_int(sizeof(host->access_recv));
24642485
host->affinity = dec_int(sizeof(host->affinity));
2486+
host->alt_port = dec_int(sizeof(host->alt_port));
24652487
host->flip = dec_int(sizeof(host->flip));
24662488
host->msg_size = dec_int(sizeof(host->msg_size));
24672489
host->mtu_size = dec_int(sizeof(host->mtu_size));

src/qperf.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#define cardof(a) (sizeof(a)/sizeof(*a))
5050
#define endof(a) (&a[cardof(a)])
5151
#define streq(a, b) (strcmp(a, b) == 0)
52-
#define offset(t, e) ((int)&((t *)0)->e)
52+
#define offset(t, e) ((long)&((t *)0)->e)
5353
#define is_client() (ServerName != 0)
5454
#define is_sender() (Req.flip ? !is_client() : is_client())
5555

@@ -97,6 +97,8 @@ typedef enum {
9797
R_ACCESS_RECV,
9898
L_AFFINITY,
9999
R_AFFINITY,
100+
L_ALT_PORT,
101+
R_ALT_PORT,
100102
L_FLIP,
101103
R_FLIP,
102104
L_ID,
@@ -153,6 +155,7 @@ typedef struct REQ {
153155
uint16_t req_index; /* Request index (into Tests) */
154156
uint32_t access_recv; /* Access data after receiving */
155157
uint32_t affinity; /* Processor affinity */
158+
uint32_t alt_port; /* Alternate path port number */
156159
uint32_t flip; /* Flip sender/receiver */
157160
uint32_t msg_size; /* Message Size */
158161
uint32_t mtu_size; /* MTU Size */
@@ -343,6 +346,12 @@ void run_client_ver_rc_compare_swap(void);
343346
void run_server_ver_rc_compare_swap(void);
344347
void run_client_ver_rc_fetch_add(void);
345348
void run_server_ver_rc_fetch_add(void);
349+
void run_client_xrc_bi_bw(void);
350+
void run_server_xrc_bi_bw(void);
351+
void run_client_xrc_bw(void);
352+
void run_server_xrc_bw(void);
353+
void run_client_xrc_lat(void);
354+
void run_server_xrc_lat(void);
346355

347356

348357
/*

0 commit comments

Comments
 (0)