More clean up and minor bug fixes

master
Johann George (QLogic) 2008-02-17 15:37:52 -08:00
parent 782a713d05
commit 8ab8f5379c
7 changed files with 580 additions and 516 deletions

4
README
View File

@ -4,6 +4,10 @@ To build
./configure
make
Changing version
* Change VER_MAJ, VER_MIN and VER_INC as appropriate in src/qperf.c
* Change version also in qperf.spec and configure.in
Notes
* If the library ibverbs is not found, a version of qperf is built that
does not support the RDMA tests.

View File

@ -1,5 +1,5 @@
AC_INIT(qperf, 0.3.0, general@lists.openfabrics.org)
AM_INIT_AUTOMAKE(qperf, 0.3.0)
AC_INIT(qperf, 0.4.0, general@lists.openfabrics.org)
AM_INIT_AUTOMAKE(qperf, 0.4.0)
AC_PROG_CC
AC_CHECK_LIB(ibverbs, ibv_open_device, RDMA=1)
AM_CONDITIONAL(RDMA, test -n "$RDMA")

View File

@ -1,6 +1,6 @@
Name: qperf
Summary: Measure socket and RDMA performance
Version: 0.3.0
Version: 0.4.0
Release: 1
License: BSD 3-Clause, GPL v2
Group: Networking/Diagnostic

View File

@ -117,30 +117,30 @@ Opts
--flip OnOff (-f) Flip sender and receiver
--help Topic (-h) Get more information on a topic
--host Node (-H) Identify server node
--id Device:Port (-i) Set IB device and port
--loc_id Device:Port (-li) Set local IB device and port
--rem_id Device:Port (-ri) Set remote IB device and port
--id Device:Port (-i) Set RDMA device and port
--loc_id Device:Port (-li) Set local RDMA device and port
--rem_id Device:Port (-ri) Set remote RDMA device and port
--listen_port Port (-lp) Set server listen port
--msg_size Size (-m) Set message size
--mtu_size Size (-M) Set MTU size (IB only)
--mtu_size Size (-mt) Set MTU size (RDMA only)
--no_msgs Count (-n) Send Count messages
--poll OnOff (-P) Set polling mode on/off
--loc_poll OnOff (-lP) Set local polling mode on/off
--rem_poll OnOff (-lP) Set remote polling mode on/off
--port Port (-p) Set TCP port used for tests
--precision Digits (-e) Set precision reported
--rate (-r) Set IB static rate
--loc_rate (-lr) Set local IB static rate
--rem_rate (-rr) Set remote IB static rate
--rd_atomic Count (-R) Set RDMA read/atomic count
--loc_rd_atomic Count (-lR) Set local RDMA read/atomic count
--rem_rd_atomic Count (-rR) Set remote RDMA read/atomic count
--rd_atomic Max (-nr) Set RDMA read/atomic count
--loc_rd_atomic Max (-lnr) Set local RDMA read/atomic count
--rem_rd_atomic Max (-rnr) Set remote RDMA read/atomic count
--service_level SL (-sl) Set service level
--service_level SL (-lsl) Set local service level
--service_level SL (-rsl) Set remote service level
--sock_buf_size Size (-sb) Set socket buffer size
--loc_sock_buf_size Size (-lsb) Set local socket buffer size
--rem_sock_buf_size Size (-rsb) Set remote socket buffer size
--static_rate (-sr) Set IB static rate
--loc_rate (-lr) Set local IB static rate
--rem_rate (-rr) Set remote IB static rate
--time Time (-t) Set test duration
--timeout Time (-to) Set timeout
--loc_timeout Time (-lto) Set local timeout
@ -198,7 +198,7 @@ Options
specified in kibibytes, mebibytes or gibibytes respectively while a
trailing kb or k, mb or m, or gb or g indicates kilobytes, megabytes
or gigabytes respectively.
--mtu_size Size (-M)
--mtu_size Size (-mt)
Set the MTU size. Only relevant to the RDMA UC/RC tests. Units are
specified in the same manner as the --msg_size option.
--no_msgs N (-n)
@ -218,21 +218,13 @@ Options
that the test is run on.
--precision Digits (-e)
Set the number of significant digits that are used to report results.
--rate Rate (-r)
Force InfiniBand static rate. Rate can be one of: 2.5, 5, 10, 20,
30, 40, 60, 80, 120, 1xSDR (2.5 Gbps), 1xDDR (5 Gbps), 1xQDR (10
Gbps), 4xSDR (2.5 Gbps), 4xDDR (5 Gbps), 4xQDR (10 Gbps), 8xSDR (2.5
Gbps), 8xDDR (5 Gbps), 8xQDR (10 Gbps).
--loc_rate (-lr)
Force local InfiniBand static rate
--rem_rate (-rr)
Force remote InfiniBand static rate
--rd_atomic Count (-R)
--rd_atomic Max (-nr)
Set the number of in-flight operations that can be handled for a RDMA
read or atomic operation. This is only relevant to the RDMA tests.
--loc_rd_atomic Count (-lR)
read or atomic operation to Max. This is only relevant to the RDMA
Read and Atomic tests.
--loc_rd_atomic Max (-lnr)
Set local read/atomic count.
--rem_rd_atomic Count (-rR)
--rem_rd_atomic Max (-rnr)
Set remote read/atomic count.
--service_level SL (-sl)
Set RDMA service level to SL. This is only used by the RDMA tests.
@ -249,6 +241,15 @@ Options
Set local socket buffer size.
--rem_sock_buf_size Size (-rsb)
Set remote socket buffer size.
--static_rate Rate (-sr)
Force InfiniBand static rate. Rate can be one of: 2.5, 5, 10, 20,
30, 40, 60, 80, 120, 1xSDR (2.5 Gbps), 1xDDR (5 Gbps), 1xQDR (10
Gbps), 4xSDR (2.5 Gbps), 4xDDR (5 Gbps), 4xQDR (10 Gbps), 8xSDR (2.5
Gbps), 8xDDR (5 Gbps), 8xQDR (10 Gbps).
--loc_rate (-lr)
Force local InfiniBand static rate
--rem_rate (-rr)
Force remote InfiniBand static rate
--time Time (-t)
Set test duration to Time. Specified in seconds however a trailing
m, h or d indicates that the time is specified in minutes, hours or
@ -256,10 +257,13 @@ Options
--timeout Time (-to)
Set timeout to Time. This is the timeout used for various things
such as exchanging messages. The default is 5 seconds.
--loc_timeout Time (-lT)
Set local timeout to Time.
--rem_timeout Time (-rT)
Set local timeout to Time.
--loc_timeout Time (-lto)
Set local timeout to Time. This may be used on the server to set the
initial timeout when exchanging data with the client. As soon as we
receive the client's parameters, the client's remote timeout
overrides this parameter.
--rem_timeout Time (-rto)
Set remote timeout to Time.
--unify_nodes (-un)
Unify the nodes. Describe them in terms of local and remote rather
than send and receive.
@ -528,12 +532,12 @@ ud_bw +RDMA
UD streaming one way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -545,12 +549,12 @@ ud_bi_bw +RDMA
UD streaming two way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -561,12 +565,12 @@ ud_lat +RDMA
Purpose
UD one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -577,12 +581,12 @@ rc_bw +RDMA
RC streaming one way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -594,12 +598,12 @@ rc_bi_bw +RDMA
RC streaming two way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -610,12 +614,12 @@ rc_lat +RDMA
Purpose
RC one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -626,12 +630,12 @@ uc_bw +RDMA
UC streaming one way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -643,12 +647,12 @@ uc_bi_bw +RDMA
UC streaming two way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -659,12 +663,12 @@ uc_lat +RDMA
Purpose
UC one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -675,12 +679,13 @@ rc_rdma_read_bw +RDMA
RC RDMA read streaming one way bandwidth
Common Options
--access_recv OnOff (-ar) Access received data
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --rd_atomic, --timeout
--affinity, --listen_port, --mtu_size, --rd_atomic, --static_rate,
--timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -691,12 +696,12 @@ rc_rdma_read_lat +RDMA
Purpose
RC RDMA read one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -706,12 +711,12 @@ rc_rdma_write_bw +RDMA
Purpose
RC RDMA write streaming one way bandwidth
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -722,12 +727,12 @@ rc_rdma_write_lat +RDMA
Purpose
RC RDMA write one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -737,11 +742,11 @@ rc_rdma_write_poll_lat +RDMA
Purpose
RC RDMA write one way polling latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -755,12 +760,12 @@ uc_rdma_write_bw +RDMA
Purpose
UC RDMA write streaming one way bandwidth
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose
@ -771,12 +776,12 @@ uc_rdma_write_lat +RDMA
Purpose
UC RDMA write one way latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -786,11 +791,11 @@ uc_rdma_write_poll_lat +RDMA
Purpose
UC RDMA write one way polling latency
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--msg_size Size (-m) Set message size
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --timeout
--affinity, --listen_port, --mtu_size, --static_rate, --timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -804,11 +809,12 @@ rc_compare_swap_mr +RDMA
Purpose
RC compare and swap messaging rate
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --rd_atomic, --timeout
--affinity, --listen_port, --mtu_size, --rd_atomic, --static_rate,
--timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -818,11 +824,12 @@ rc_fetch_add_mr +RDMA
Purpose
RC fetch and add messaging rate
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --rd_atomic, --timeout
--affinity, --listen_port, --mtu_size, --rd_atomic, --static_rate,
--timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -832,11 +839,12 @@ ver_rc_compare_swap +RDMA
Purpose
Verify RC compare and swap
Common Options
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --rd_atomic, --timeout
--affinity, --listen_port, --mtu_size, --rd_atomic, --static_rate,
--timeout
Display Options
--precision, --unify_nodes, --unify_units, --verbose
Description
@ -848,11 +856,12 @@ ver_rc_fetch_add +RDMA
Verify RC fetch and add
Common Options
--affinity PN (-a) Set processor affinity
--id Device:Port (-i) Set IB device and port
--id Device:Port (-i) Set RDMA device and port
--poll OnOff (-P) Set polling mode on/off
--time (-t) Set test duration
Other Options
--affinity, --listen_port, --mtu_size, --rate, --rd_atomic, --timeout
--affinity, --listen_port, --mtu_size, --rd_atomic, --static_rate,
--timeout
Display Options
--precision, --unify_nodes, --unify_units, --use_bits_per_sec,
--verbose

View File

@ -60,12 +60,20 @@
* increment VER_MIN and set VER_INC to 0. Otherwise, just increment VER_INC.
* VER_MAJ is reserved for major changes.
*/
#define VER_MAJ 0 /* Major version */
#define VER_MIN 3 /* Minor version */
#define VER_INC 0 /* Incremental version */
#define LISTENQ 5 /* Size of listen queue */
#define ERRTIME 3 /* Error timeout in seconds */
#define BUFSIZE 1024 /* Size of buffers */
#define VER_MAJ 0 /* Major version */
#define VER_MIN 4 /* Minor version */
#define VER_INC 0 /* Incremental version */
#define LISTENQ 5 /* Size of listen queue */
#define BUFSIZE 1024 /* Size of buffers */
/*
* Default parameter values.
*/
#define DEF_TIME 2 /* Test duration in seconds */
#define DEF_TIMEOUT 5 /* Timeout in seconds */
#define DEF_PRECISION 3 /* Precision of results */
#define DEF_LISTEN_PORT 19765 /* Listen port */
/*
@ -103,6 +111,15 @@ typedef struct PAR_NAME {
} PAR_NAME;
/*
* A simple mapping between two strings.
*/
typedef struct DICT {
char *str1; /* String 1 */
char *str2; /* String 2 */
} DICT;
/*
* Test prototype.
*/
@ -209,9 +226,8 @@ static void view_time(int type, char *pref, char *name, double value);
/*
* Configurable variables.
*/
static int ListenPort = 19765;
static int Precision = 3;
static int ServerTimeout = 5;
static int ListenPort = DEF_LISTEN_PORT;
static int Precision = DEF_PRECISION;
static int UseBitsPerSec = 0;
@ -268,6 +284,7 @@ PAR_NAME ParName[] ={
{ "sock_buf_size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "time", L_TIME, R_TIME },
{ "timeout", L_TIMEOUT, R_TIMEOUT },
{ "use_cm", L_USE_CM, R_USE_CM },
};
@ -295,18 +312,49 @@ PAR_INFO ParInfo[P_N] ={
{ R_POLL_MODE, 'l', &RReq.poll_mode },
{ L_PORT, 'l', &Req.port },
{ R_PORT, 'l', &RReq.port },
{ L_RATE, 'p', &Req.rate },
{ R_RATE, 'p', &RReq.rate },
{ L_RD_ATOMIC, 'l', &Req.rd_atomic },
{ R_RD_ATOMIC, 'l', &RReq.rd_atomic },
{ L_SL, 'l', &Req.sl },
{ R_SL, 'l', &RReq.sl },
{ L_SOCK_BUF_SIZE, 's', &Req.sock_buf_size },
{ R_SOCK_BUF_SIZE, 's', &RReq.sock_buf_size },
{ L_STATIC_RATE, 'p', &Req.static_rate },
{ R_STATIC_RATE, 'p', &RReq.static_rate },
{ L_TIME, 't', &Req.time },
{ R_TIME, 't', &RReq.time },
{ L_TIMEOUT, 't', &Req.timeout },
{ R_TIMEOUT, 't', &RReq.timeout },
{ L_USE_CM, 'l', &Req.use_cm },
{ R_USE_CM, 'l', &RReq.use_cm },
};
/*
* Renamed options. First is old, second is new.
*/
DICT Renamed[] = {
{ "--rate", "--static_rate" },
{ "-r", "-sr" },
{ "--loc_rate", "--loc_static_rate" },
{ "-lr", "-lsr" },
{ "--rem_rate", "--rem_static_rate" },
{ "-rr", "-rsr" },
{ "-R", "-nr" },
{ "-lR", "-lnr" },
{ "-rR", "-rnr" },
{ "-Ar", "-ar" },
{ "-M", "-mt" },
{ "-S", "-sb" },
{ "-lS", "-lsb" },
{ "-rS", "-rsb" },
{ "-T", "-to" },
{ "-lT", "-lto" },
{ "-rT", "-rto" },
{ "-u", "-uu", },
{ "-vC", "-vvc", },
{ "-vS", "-vvs", },
{ "-vT", "-vvt", },
{ "-vU", "-vvu", },
};
@ -316,122 +364,110 @@ PAR_INFO ParInfo[P_N] ={
* obsolete and will eventually go away.
*/
OPTION Options[] ={
{ "--access_recv", "int", L_ACCESS_RECV, R_ACCESS_RECV },
{ "-ar", "int", L_ACCESS_RECV, R_ACCESS_RECV },
{ "--affinity", "int", L_AFFINITY, R_AFFINITY },
{ "-a", "int", L_AFFINITY, R_AFFINITY },
{ "--loc_affinity", "int", L_AFFINITY, },
{ "-la", "int", L_AFFINITY, },
{ "--rem_affinity", "int", R_AFFINITY },
{ "-ra", "int", R_AFFINITY },
{ "--debug", "Sdebug", },
{ "-D", "Sdebug", },
{ "--flip", "int", L_FLIP, R_FLIP },
{ "-f", "int", L_FLIP, R_FLIP },
{ "--help", "help" },
{ "-h", "help" },
{ "--host", "host", },
{ "-H", "host", },
{ "--id", "str", L_ID, R_ID },
{ "-i", "str", L_ID, R_ID },
{ "--loc_id", "str", L_ID, },
{ "-li", "str", L_ID, },
{ "--rem_id", "str", R_ID },
{ "-ri", "str", R_ID },
{ "--listen_port", "Slp", },
{ "-lp", "Slp", },
{ "--msg_size", "size", L_MSG_SIZE, R_MSG_SIZE },
{ "-m", "size", L_MSG_SIZE, R_MSG_SIZE },
{ "--mtu_size", "size", L_MTU_SIZE, R_MTU_SIZE },
{ "-M", "size", L_MTU_SIZE, R_MTU_SIZE },
{ "--no_msgs", "int", L_NO_MSGS, R_NO_MSGS },
{ "-n", "int", L_NO_MSGS, R_NO_MSGS },
{ "--poll", "int", L_POLL_MODE, R_POLL_MODE },
{ "-P", "int", L_POLL_MODE, R_POLL_MODE },
{ "--loc_poll", "int", L_POLL_MODE, },
{ "-lP", "int", L_POLL_MODE, },
{ "--rem_poll", "int", R_POLL_MODE },
{ "-rP", "int", R_POLL_MODE },
{ "--port", "int", L_PORT, R_PORT },
{ "-p", "int", L_PORT, R_PORT },
{ "--precision", "precision", },
{ "-e", "precision", },
{ "--rate", "str", L_RATE, R_RATE },
{ "-r", "str", L_RATE, R_RATE },
{ "--loc_rate", "str", L_RATE },
{ "-lr", "str", L_RATE },
{ "--rem_rate", "str", R_RATE },
{ "-rr", "str", R_RATE },
{ "-rd_atomic", "int", L_RD_ATOMIC, R_RD_ATOMIC },
{ "-R", "int", L_RD_ATOMIC, R_RD_ATOMIC },
{ "--loc_rd_atomic", "int", L_RD_ATOMIC, },
{ "-lR", "int", L_RD_ATOMIC, },
{ "--rem_rd_atomic", "int", R_RD_ATOMIC },
{ "-rR", "int", R_RD_ATOMIC },
{ "--service_level", "sl", L_SL, R_SL },
{ "-sl", "sl", L_SL, R_SL },
{ "--loc_service_level", "sl", L_SL },
{ "-lsl", "sl", L_SL },
{ "--rem_service_level", "sl", R_SL },
{ "-rsl", "sl", R_SL },
{ "--sock_buf_size", "size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "-sb", "size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "--loc_sock_buf_size", "size", L_SOCK_BUF_SIZE },
{ "-lsb", "size", L_SOCK_BUF_SIZE },
{ "--rem_sock_buf_size", "size", R_SOCK_BUF_SIZE },
{ "-rsb", "size", R_SOCK_BUF_SIZE },
{ "--time", "time", L_TIME, R_TIME },
{ "-t", "time", L_TIME, R_TIME },
{ "--timeout", "time", L_TIMEOUT, R_TIMEOUT },
{ "-to", "time", L_TIMEOUT, R_TIMEOUT },
{ "--loc_timeout", "time", L_TIMEOUT },
{ "-lto", "time", L_TIMEOUT },
{ "--rem_timeout", "time", R_TIMEOUT },
{ "-rto", "time", R_TIMEOUT },
{ "--unify_nodes", "un", },
{ "-un", "un", },
{ "--unify_units", "uu", },
{ "-uu", "uu", },
{ "--use_bits_per_sec", "ub", },
{ "-ub", "ub", },
{ "--verbose", "v", },
{ "-v", "v", },
{ "--verbose_conf", "vc", },
{ "-vc", "vc", },
{ "--verbose_stat", "vs", },
{ "-vs", "vs", },
{ "--verbose_time", "vt", },
{ "-vt", "vt", },
{ "--verbose_used", "vu", },
{ "-vu", "vu", },
{ "--verbose_more", "vv", },
{ "-vv", "vv", },
{ "--verbose_more_conf", "vvc", },
{ "-vvc", "vvc", },
{ "--verbose_more_stat", "vvs", },
{ "-vvs", "vvs", },
{ "--verbose_more_time", "vvt", },
{ "-vvt", "vvt", },
{ "--verbose_more_used", "vvu", },
{ "-vvu", "vvu", },
{ "--version", "version", },
{ "-V", "version", },
{ "--wait", "wait", },
{ "-W", "wait", },
/* Obsolete options */
{ "-Ar", "int", L_ACCESS_RECV, R_ACCESS_RECV },
{ "-S", "size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "-T", "time", L_TIMEOUT, R_TIMEOUT },
{ "-lT", "time", L_TIMEOUT },
{ "-rT", "time", R_TIMEOUT },
{ "-lS", "size", L_SOCK_BUF_SIZE },
{ "-rS", "size", R_SOCK_BUF_SIZE },
{ "-u", "Xuu", },
{ "-vC", "Xvvc", },
{ "-vS", "Xvvs", },
{ "-vT", "Xvvt", },
{ "-vU", "Xvvu", },
{ "--access_recv", "int", L_ACCESS_RECV, R_ACCESS_RECV },
{ "-ar", "int", L_ACCESS_RECV, R_ACCESS_RECV },
{ "--affinity", "int", L_AFFINITY, R_AFFINITY },
{ "-a", "int", L_AFFINITY, R_AFFINITY },
{ "--loc_affinity", "int", L_AFFINITY, },
{ "-la", "int", L_AFFINITY, },
{ "--rem_affinity", "int", R_AFFINITY },
{ "-ra", "int", R_AFFINITY },
{ "--debug", "Sdebug", },
{ "-D", "Sdebug", },
{ "--flip", "int", L_FLIP, R_FLIP },
{ "-f", "int", L_FLIP, R_FLIP },
{ "--help", "help" },
{ "-h", "help" },
{ "--host", "host", },
{ "-H", "host", },
{ "--id", "str", L_ID, R_ID },
{ "-i", "str", L_ID, R_ID },
{ "--loc_id", "str", L_ID, },
{ "-li", "str", L_ID, },
{ "--rem_id", "str", R_ID },
{ "-ri", "str", R_ID },
{ "--listen_port", "Slp", },
{ "-lp", "Slp", },
{ "--msg_size", "size", L_MSG_SIZE, R_MSG_SIZE },
{ "-m", "size", L_MSG_SIZE, R_MSG_SIZE },
{ "--mtu_size", "size", L_MTU_SIZE, R_MTU_SIZE },
{ "-mt", "size", L_MTU_SIZE, R_MTU_SIZE },
{ "--no_msgs", "int", L_NO_MSGS, R_NO_MSGS },
{ "-n", "int", L_NO_MSGS, R_NO_MSGS },
{ "--poll", "int", L_POLL_MODE, R_POLL_MODE },
{ "-P", "int", L_POLL_MODE, R_POLL_MODE },
{ "--loc_poll", "int", L_POLL_MODE, },
{ "-lP", "int", L_POLL_MODE, },
{ "--rem_poll", "int", R_POLL_MODE },
{ "-rP", "int", R_POLL_MODE },
{ "--port", "int", L_PORT, R_PORT },
{ "-p", "int", L_PORT, R_PORT },
{ "--precision", "precision", },
{ "-e", "precision", },
{ "--rd_atomic", "int", L_RD_ATOMIC, R_RD_ATOMIC },
{ "-nr", "int", L_RD_ATOMIC, R_RD_ATOMIC },
{ "--loc_rd_atomic", "int", L_RD_ATOMIC, },
{ "-lnr", "int", L_RD_ATOMIC, },
{ "--rem_rd_atomic", "int", R_RD_ATOMIC },
{ "-rnr", "int", R_RD_ATOMIC },
{ "--service_level", "sl", L_SL, R_SL },
{ "-sl", "sl", L_SL, R_SL },
{ "--loc_service_level", "sl", L_SL },
{ "-lsl", "sl", L_SL },
{ "--rem_service_level", "sl", R_SL },
{ "-rsl", "sl", R_SL },
{ "--sock_buf_size", "size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "-sb", "size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
{ "--loc_sock_buf_size", "size", L_SOCK_BUF_SIZE },
{ "-lsb", "size", L_SOCK_BUF_SIZE },
{ "--rem_sock_buf_size", "size", R_SOCK_BUF_SIZE },
{ "-rsb", "size", R_SOCK_BUF_SIZE },
{ "--static_rate", "str", L_STATIC_RATE, R_STATIC_RATE },
{ "-sr", "str", L_STATIC_RATE, R_STATIC_RATE },
{ "--loc_static_rate", "str", L_STATIC_RATE },
{ "-lsr", "str", L_STATIC_RATE },
{ "--rem_static_rate", "str", R_STATIC_RATE },
{ "-rsr", "str", R_STATIC_RATE },
{ "--time", "time", L_TIME, R_TIME },
{ "-t", "time", L_TIME, R_TIME },
{ "--timeout", "time", L_TIMEOUT, R_TIMEOUT },
{ "-to", "time", L_TIMEOUT, R_TIMEOUT },
{ "--loc_timeout", "Stime", L_TIMEOUT },
{ "-lto", "Stime", L_TIMEOUT },
{ "--rem_timeout", "time", R_TIMEOUT },
{ "-rto", "time", R_TIMEOUT },
{ "--unify_nodes", "un", },
{ "-un", "un", },
{ "--unify_units", "uu", },
{ "-uu", "uu", },
{ "--use_bits_per_sec", "ub", },
{ "-ub", "ub", },
{ "--use_cm", "int", L_USE_CM, R_USE_CM },
{ "-cm", "int", L_USE_CM, R_USE_CM },
{ "--verbose", "v", },
{ "-v", "v", },
{ "--verbose_conf", "vc", },
{ "-vc", "vc", },
{ "--verbose_stat", "vs", },
{ "-vs", "vs", },
{ "--verbose_time", "vt", },
{ "-vt", "vt", },
{ "--verbose_used", "vu", },
{ "-vu", "vu", },
{ "--verbose_more", "vv", },
{ "-vv", "vv", },
{ "--verbose_more_conf", "vvc", },
{ "-vvc", "vvc", },
{ "--verbose_more_stat", "vvs", },
{ "-vvs", "vvs", },
{ "--verbose_more_time", "vvt", },
{ "-vvt", "vvt", },
{ "--verbose_more_used", "vvu", },
{ "-vvu", "vvu", },
{ "--version", "version", },
{ "-V", "version", },
{ "--wait", "wait", },
{ "-W", "wait", },
};
@ -645,7 +681,7 @@ do_args(char *args[])
server();
else if (!testSpecified) {
if (!ServerName)
error(0, "you used a client only option but did not specify the "
error(0, "you used a client-only option but did not specify the "
"server name.\nDo you want to be a client or server?");
if (find_test(ServerName))
error(0, "must specify host name first; try: qperf --help");
@ -660,8 +696,23 @@ do_args(char *args[])
static OPTION *
find_option(char *name)
{
int n = cardof(Options);
OPTION *p = Options;
int n;
DICT *d;
OPTION *p;
n = cardof(Renamed);
d = Renamed;
for (; n--; ++d) {
if (streq(name, d->str1)) {
char *msg = "warning: obsolete option: %s; use %s instead";
error(RET, msg, name, d->str2);
name = d->str2;
break;
}
}
n = cardof(Options);
p = Options;
for (; n--; ++p)
if (streq(name, p->name))
return p;
@ -694,11 +745,6 @@ do_option(OPTION *option, char ***argvp)
if (*t == 'S')
++t;
if (*t == 'X') {
++t;
error(RET, "warning: obsolete option: %s; use -%s instead",
option->name, t);
}
if (streq(t, "debug")) {
Debug = 1;
@ -740,7 +786,6 @@ do_option(OPTION *option, char ***argvp)
setp_u32(option->name, option->arg1, v);
setp_u32(option->name, option->arg2, v);
} else if (streq(t, "str")) {
/* String */
char *s = arg_strn(argvp);
setp_str(option->name, option->arg1, s);
setp_str(option->name, option->arg2, s);
@ -763,8 +808,8 @@ do_option(OPTION *option, char ***argvp)
if (VerboseStat < 1)
VerboseStat = 1;
if (VerboseTime < 1)
VerboseUsed = 1;
if (VerboseConf < 1)
VerboseTime = 1;
if (VerboseUsed < 1)
VerboseUsed = 1;
*argvp += 1;
} else if (streq(t, "vc")) {
@ -1149,7 +1194,8 @@ server_listen(void)
if (!ai)
error(0, "unable to bind to listen port");
Req.timeout = ServerTimeout;
if (!Req.timeout)
Req.timeout = DEF_TIMEOUT;
if (listen(ListenFD, LISTENQ) < 0)
error(SYS, "listen failed");
}
@ -1183,11 +1229,11 @@ client(TEST *test)
for (i = 0; i < P_N; ++i)
ParInfo[i].inuse = 0;
if (!par_isset(L_NO_MSGS))
setp_u32(0, L_TIME, 2);
setp_u32(0, L_TIME, DEF_TIME);
if (!par_isset(R_NO_MSGS))
setp_u32(0, R_TIME, 2);
setp_u32(0, L_TIMEOUT, 5);
setp_u32(0, R_TIMEOUT, 5);
setp_u32(0, R_TIME, DEF_TIME);
setp_u32(0, L_TIMEOUT, DEF_TIMEOUT);
setp_u32(0, R_TIMEOUT, DEF_TIMEOUT);
par_use(L_AFFINITY);
par_use(R_AFFINITY);
par_use(L_TIME);
@ -2361,8 +2407,9 @@ enc_req(REQ *host)
enc_int(host->sock_buf_size, sizeof(host->sock_buf_size));
enc_int(host->time, sizeof(host->time));
enc_int(host->timeout, sizeof(host->timeout));
enc_int(host->use_cm, sizeof(host->use_cm));
enc_str(host->id, sizeof(host->id));
enc_str(host->rate, sizeof(host->rate));
enc_str(host->static_rate, sizeof(host->static_rate));
}
@ -2389,8 +2436,9 @@ dec_req(REQ *host)
host->sock_buf_size = dec_int(sizeof(host->sock_buf_size));
host->time = dec_int(sizeof(host->time));
host->timeout = dec_int(sizeof(host->timeout));
dec_str(host->id, sizeof(host->id));
dec_str(host->rate, sizeof(host->rate));
host->use_cm = dec_int(sizeof(host->use_cm));
dec_str(host->id, sizeof(host->id));
dec_str(host->static_rate,sizeof(host->static_rate));
}

View File

@ -109,18 +109,20 @@ typedef enum {
R_POLL_MODE,
L_PORT,
R_PORT,
L_RATE,
R_RATE,
L_RD_ATOMIC,
R_RD_ATOMIC,
L_SL,
R_SL,
L_SOCK_BUF_SIZE,
R_SOCK_BUF_SIZE,
L_STATIC_RATE,
R_STATIC_RATE,
L_TIME,
R_TIME,
L_TIMEOUT,
R_TIMEOUT,
L_USE_CM,
R_USE_CM,
P_N
} PAR_INDEX;
@ -159,8 +161,9 @@ typedef struct REQ {
uint32_t sock_buf_size; /* Socket buffer size */
uint32_t time; /* Duration in seconds */
uint32_t timeout; /* Timeout for messages */
uint32_t use_cm; /* Use Connection Manager */
char id[STRSIZE]; /* Identifier */
char rate[STRSIZE]; /* Rate */
char static_rate[STRSIZE]; /* Static rate */
} REQ;

File diff suppressed because it is too large Load Diff