]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
dapltest: add -n parameter to override default server port number (45278)
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 16 Jul 2013 23:12:37 +0000 (16:12 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 16 Jul 2013 23:12:37 +0000 (16:12 -0700)
Modify all tests and commands to take a new -n parameter option for server
listen port. The default port, when running multiple EP's and threads,
will sometimes collide and fail with EADDRINUSE on iWARP configurations
using rdma_bind_addr with sin_port=0.

Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
20 files changed:
man/dapltest.1
test/dapltest/cmd/dapl_fft_cmd.c
test/dapltest/cmd/dapl_limit_cmd.c
test/dapltest/cmd/dapl_main.c
test/dapltest/cmd/dapl_params.c
test/dapltest/cmd/dapl_performance_cmd.c
test/dapltest/cmd/dapl_server_cmd.c
test/dapltest/cmd/dapl_transaction_cmd.c
test/dapltest/include/dapl_common.h
test/dapltest/include/dapl_fft_cmd.h
test/dapltest/include/dapl_limit_cmd.h
test/dapltest/include/dapl_params.h
test/dapltest/include/dapl_performance_cmd.h
test/dapltest/include/dapl_server_cmd.h
test/dapltest/include/dapl_server_info.h
test/dapltest/include/dapl_transaction_cmd.h
test/dapltest/test/dapl_client.c
test/dapltest/test/dapl_fft_queryinfo.c
test/dapltest/test/dapl_fft_util.c
test/dapltest/test/dapl_server.c

index c1c468295eec0a5a486611b3b46091946a225d00..62b44bbbc0ec50af076e4527759f209b131883ff 100644 (file)
@@ -1,5 +1,5 @@
 ." Text automatically generated by txt2man
-.TH dapltest 1 "February 23, 2007" "uDAPL 1.2" "USER COMMANDS"
+.TH dapltest 1 "July 16, 2013" "uDAPL 2.0" "USER COMMANDS"
 
 .SH NAME
 \fB
@@ -23,7 +23,7 @@ needed to run the test before awaiting further connections.
 .SH USAGE
 
 dapltest [ -f script_file_name ]
-[ -T S|Q|T|P|L ] [ -D device_name ] [ -d ] [ -R HT|LL|EC|PM|BE ]
+[ -T S|Q|T|P|L ] [ -D device_name ] [-n port_number] [ -d ] [ -R HT|LL|EC|PM|BE ]
 .PP
 With no arguments, dapltest runs as a server using default values,
 and loops accepting requests from clients.
@@ -72,6 +72,11 @@ corresponds to the provider library to open.
 Default: none
 .TP
 .B
+[ -n server_port_number]
+Specifies the starting server port for all tests.
+Default: 45278
+.TP
+.B
 [ -d ]
 Enables extra debug verbosity, primarily tracing
 of the various DAPL operations as they progress.
@@ -314,21 +319,21 @@ Usage - Limit test client
 .fi
 .SH EXAMPLES
 
-dapltest -T S -d -D OpenIB-cma
+dapltest -T S -d -D OpenIB-cma -n 53000
 .PP
 .nf
 .fam C
-                        Starts a server process with debug verbosity.
+                        Starts a server process with debug verbosity, on server port 53000.
 
 .fam T
 .fi
-dapltest -T T -d -s host1-ib0 -D OpenIB-cma -i 100 client SR 4096 2 server SR 4096 2
+dapltest -T T -d -s host1-ib0 -D OpenIB-cma -n 53000 -i 100 client SR 4096 2 server SR 4096 2
 .PP
 .nf
 .fam C
                         Runs a transaction test, with both sides
                         sending one buffer with two 4KB segments,
-                        one hundred times.
+                        one hundred times. To server host1-ib0 on port 53000
 
 .fam T
 .fi
index a604e9368e9632a1af0ed5886ebe7c9a92f22acf..742fd465e20c9a974127c39ce02eb8e8e4c0d3a0 100644 (file)
@@ -45,6 +45,7 @@ void DT_FFT_Cmd_Init(FFT_Cmd_t * cmd)
        cmd->num_iter = 1000;
        cmd->num_threads = 10;
        cmd->num_vis = 500;
+       cmd->port = SERVER_PORT_NUMBER;
        cmd->ReliabilityLevel = DAT_QOS_BEST_EFFORT;
 }
 
@@ -57,7 +58,7 @@ bool DT_FFT_Cmd_Parse(FFT_Cmd_t * cmd,
        unsigned int len;
 
        for (;;) {
-               c = DT_mygetopt_r(my_argc, my_argv, "D:f:s:i:t:v:R:", opts);
+               c = DT_mygetopt_r(my_argc, my_argv, "D:f:s:i:t:v:R:n:", opts);
                if (c == EOF) {
                        break;
                }
@@ -201,7 +202,11 @@ bool DT_FFT_Cmd_Parse(FFT_Cmd_t * cmd,
                                }
                                break;
                        }
-
+               case 'n':
+                       {
+                               cmd->port = atoi(opts->optarg);
+                               break;
+                       }
                case '?':
                default:
                        {
@@ -286,6 +291,7 @@ void DT_FFT_Cmd_Usage(void)
                "dapltest -T F [-D <dev_name>] -f <funcfeature> [-i <iter_num>] \n"
                    "[-t <num_threads>] [-v <num_vis>] [-s <server_name>] [case0] [case1] [...]\n"
                    "USAGE:        [-D <device Name>]\n"
+                   "USAGE:        [-n <server port number>]\n"
                    "USAGE:         -f <func_feature>\n"
                    "USAGE:             hwconn\n"
                    "USAGE:             endpoint\n"
index 69b8b7c9150119d6072176da03e347f05eaa23e9..e59707e9c016207b3cfedcdd59cf00de759f816b 100644 (file)
@@ -37,6 +37,7 @@ void DT_Limit_Cmd_Init(Limit_Cmd_t * cmd)
        cmd->ReliabilityLevel = DAT_QOS_BEST_EFFORT;
        cmd->width = 1;
        cmd->maximum = ~0U;
+       cmd->port = SERVER_PORT_NUMBER;
 }
 
 /* --------------------------------------------------- */
@@ -48,7 +49,7 @@ DT_Limit_Cmd_Parse(Limit_Cmd_t * cmd,
        int i;
 
        for (;;) {
-               c = DT_mygetopt_r(my_argc, my_argv, "dm:w:D:R:", opts);
+               c = DT_mygetopt_r(my_argc, my_argv, "dm:w:D:R:n:", opts);
                if (c == EOF) {
                        break;
                }
@@ -98,6 +99,11 @@ DT_Limit_Cmd_Parse(Limit_Cmd_t * cmd,
                                cmd->width = atol(opts->optarg);
                                break;
                        }
+               case 'n':
+                       {
+                               cmd->port = atoi(opts->optarg);
+                               break;
+                       }
                case '?':
                default:
                        {
@@ -187,25 +193,20 @@ void DT_Limit_Cmd_Usage(void)
        DT_Mdep_printf("USAGE: ---- LIMIT TEST ----\n");
        DT_Mdep_printf("USAGE:     dapltest -T L\n");
        DT_Mdep_printf("USAGE:              [-D <device Name>]\n");
+       DT_Mdep_printf("USAGE:              [-n <server port number>]\n");
        DT_Mdep_printf("USAGE:              [-d] : debug (zero)\n");
        DT_Mdep_printf("USAGE:              [-w <width_of_resource_sets>]\n");
-       DT_Mdep_printf
-           ("USAGE:              [-m <maximum_for_exhaustion_tests>]\n");
+       DT_Mdep_printf("USAGE:              [-m <maximum_for_exhaustion_tests>]\n");
        DT_Mdep_printf("USAGE:              [-R <service reliability>]\n");
-       DT_Mdep_printf
-           ("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
+       DT_Mdep_printf("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
        DT_Mdep_printf("USAGE:                  (HT == QOS_HIGH_THROUGHPUT)\n");
        DT_Mdep_printf("USAGE:                  (LL == QOS_LOW_LATENCY)\n");
        DT_Mdep_printf("USAGE:                  (EC == QOS_ECONOMY)\n");
        DT_Mdep_printf("USAGE:                  (PM == QOS_PREMIUM)\n");
-       DT_Mdep_printf
-           ("USAGE:              [limit_ia [limit_pz] [limit_evd] ... ]\n");
-       DT_Mdep_printf
-           ("NOTE: If test is not specified, do all the limit tests\n");
+       DT_Mdep_printf("USAGE:              [limit_ia [limit_pz] [limit_evd] ... ]\n");
+       DT_Mdep_printf("NOTE: If test is not specified, do all the limit tests\n");
        DT_Mdep_printf("NOTE: Else, just do the specified tests\n");
-       DT_Mdep_printf
-           ("NOTE: Each test is separated by space, the test can be:\n");
-
+       DT_Mdep_printf("NOTE: Each test is separated by space, the test can be:\n");
        DT_Mdep_printf("NOTE: [limit_ia]         test max num  of  open IAs\n");
        DT_Mdep_printf("NOTE: [limit_pz]         test max num  of  PZs\n");
 #ifndef __KDAPLTEST__
@@ -216,7 +217,6 @@ void DT_Limit_Cmd_Usage(void)
        DT_Mdep_printf("NOTE: [limit_psp]        test max num  of  PSPs\n");
        DT_Mdep_printf("NOTE: [limit_ep]         test max num  of  EPs\n");
        DT_Mdep_printf("NOTE: [limit_lmr]        test max num  of  LMRs\n");
-       DT_Mdep_printf
-           ("NOTE: [limit_rpost]      test max num  of  recvs posted\n");
+       DT_Mdep_printf("NOTE: [limit_rpost]      test max num  of  recvs posted\n");
        DT_Mdep_printf("NOTE: [limit_size_lmr]   test max size of  LMR\n");
 }
index 9ac6f12070d173bdd3e7731adf59f8887c1097b4..0de7baf5119a7c292fbf6cbee9fb0010ad3b4c48 100644 (file)
@@ -119,8 +119,7 @@ int dapltest(int argc, char *argv[])
 void Dapltest_Main_Usage(void)
 {
        DT_Mdep_printf("USAGE:\n");
-       DT_Mdep_printf
-           ("USAGE:     dapltest -T <Test_Type> [-D IA_name] [test-specific args]\n");
+       DT_Mdep_printf("USAGE:     dapltest -T <Test_Type> [-D IA_name] [-n port_number] [test-specific args]\n");
        DT_Mdep_printf("USAGE:         where <Test_Type>\n");
        DT_Mdep_printf("USAGE:         S = Run as a server\n");
        DT_Mdep_printf("USAGE:         T = Transaction Test\n");
@@ -129,11 +128,12 @@ void Dapltest_Main_Usage(void)
        DT_Mdep_printf("USAGE:         L = Limit Test\n");
        DT_Mdep_printf("USAGE:         F = FFT Test\n");
        DT_Mdep_printf("USAGE:\n");
-       DT_Mdep_printf
-           ("USAGE:         -D Interface_Adapter {default ibnic0v2}\n");
+       DT_Mdep_printf("USAGE:         -D Interface_Adapter {default ibnic0v2}\n");
+       DT_Mdep_printf("USAGE:\n");
+       DT_Mdep_printf("USAGE:         -n server_port_number {default 42768}\n");
        DT_Mdep_printf("USAGE:\n");
        DT_Mdep_printf
-           ("NOTE:\tRun as server taking defaults (dapltest -T S [-D ibnic0v2])\n");
+           ("NOTE:\tRun as server taking defaults (dapltest -T S [-D ibnic0v2] [-p 42768])\n");
        DT_Mdep_printf("NOTE:         dapltest\n");
        DT_Mdep_printf("NOTE:\n");
        DT_Mdep_printf
index 9d5e510f4b56a70eccf529a00ef4bb6d56c9a75a..e7a2006a912187ba40837da0e719e897a30cca77 100644 (file)
@@ -165,6 +165,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
                        params_ptr->ReliabilityLevel =
                            Server_Cmd->ReliabilityLevel;
                        params_ptr->debug = Server_Cmd->debug;
+                       params_ptr->server_port = Server_Cmd->port;
                        break;
                }
        case 'T':               /* Transaction Test */
@@ -180,6 +181,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
                        params_ptr->ReliabilityLevel =
                            Transaction_Cmd->ReliabilityLevel;
                        params_ptr->debug = Transaction_Cmd->debug;
+                       params_ptr->server_port = Transaction_Cmd->port;
                        DT_NetAddrLookupHostAddress(&params_ptr->server_netaddr,
                                                    Transaction_Cmd->
                                                    server_name);
@@ -213,6 +215,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
                        params_ptr->ReliabilityLevel =
                            Limit_Cmd->ReliabilityLevel;
                        params_ptr->debug = Limit_Cmd->debug;
+                       params_ptr->server_port = Limit_Cmd->port;
                        break;
                }
        case 'P':               /* Performance Test */
@@ -232,6 +235,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
 
                        params_ptr->ReliabilityLevel = Performance_Cmd->qos;
                        params_ptr->debug = Performance_Cmd->debug;
+                       params_ptr->server_port = Performance_Cmd->port;
                        DT_NetAddrLookupHostAddress(&params_ptr->server_netaddr,
                                                    Performance_Cmd->
                                                    server_name);
@@ -250,6 +254,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
                        DT_NetAddrLookupHostAddress(&params_ptr->server_netaddr,
                                                    FFT_Cmd->server_name);
                        params_ptr->debug = false;
+                       params_ptr->server_port = FFT_Cmd->port;
                        break;
                }
 
index 5f9b9f1edfb20b7645f35c231e8a9713d92d571c..de38abfbb905b677c391c82b527e6c1a317b5353 100644 (file)
@@ -35,15 +35,14 @@ static void DT_Performance_Cmd_Usage(void)
        DT_Mdep_printf("USAGE: ---- PERFORMANCE TEST ----\n");
        DT_Mdep_printf("USAGE:     dapltest -T P\n");
        DT_Mdep_printf("USAGE:              -s <server Name>\n");
+       DT_Mdep_printf("USAGE:              -n <server port number>\n");
        DT_Mdep_printf("USAGE:              [-m b|p]\n");
        DT_Mdep_printf("USAGE:              [-D <device Name>]\n");
        DT_Mdep_printf("USAGE:              [-d] : debug (zero)\n");
-       DT_Mdep_printf
-           ("USAGE:              [-i <num iterations>]     : (1, 000)\n");
+       DT_Mdep_printf("USAGE:              [-i <num iterations>]     : (1, 000)\n");
        DT_Mdep_printf("USAGE:              [-p <pipline>]\n");
        DT_Mdep_printf("USAGE:              [-R <service reliability>]\n");
-       DT_Mdep_printf
-           ("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
+       DT_Mdep_printf("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
        DT_Mdep_printf("USAGE:                  (HT == QOS_HIGH_THROUGHPUT)\n");
        DT_Mdep_printf("USAGE:                  (LL == QOS_LOW_LATENCY)\n");
        DT_Mdep_printf("USAGE:                  (EC == QOS_ECONOMY)\n");
@@ -145,7 +144,7 @@ DT_Performance_Cmd_Parse(Performance_Cmd_t * cmd,
        unsigned int len;
 
        for (;;) {
-               c = DT_mygetopt_r(my_argc, my_argv, "D:dm:i:p:R:s:", opts);
+               c = DT_mygetopt_r(my_argc, my_argv, "D:dm:i:p:R:s:n:", opts);
 
                if (EOF == c) {
                        break;
@@ -224,6 +223,11 @@ DT_Performance_Cmd_Parse(Performance_Cmd_t * cmd,
                                        NAME_SZ);
                                break;
                        }
+               case 'n':
+                       {
+                               cmd->port = atoi(opts->optarg);
+                               break;
+                       }
                default:
                        {
                                DT_Mdep_printf
@@ -260,7 +264,7 @@ bool DT_Performance_Cmd_Init(Performance_Cmd_t * cmd)
        cmd->debug = false;
        cmd->num_iterations = 1000;
        cmd->pipeline_len = ~0;
-
+       cmd->port = SERVER_PORT_NUMBER;
        cmd->op.transfer_type = RDMA_WRITE;
        cmd->op.seg_size = 4096;
        cmd->op.num_segs = 1;
@@ -278,6 +282,8 @@ void DT_Performance_Cmd_Print(Performance_Cmd_t * cmd)
        DT_Mdep_printf("-------------------------------------\n");
        DT_Mdep_printf("PerfCmd.server_name              : %s\n",
                       cmd->server_name);
+       DT_Mdep_printf("PerfCmd.server_port_number       : %d\n",
+                      cmd->port);
        DT_Mdep_printf("PerfCmd.dapl_name                : %s\n",
                       cmd->dapl_name);
        DT_Mdep_printf("PerfCmd.mode                     : %s\n",
index 5859471d9478fe39c9bbbc6b4543e3249d463e85..219b8decf19b7dae6d9eef7264b3a9580b613a78 100644 (file)
@@ -34,6 +34,7 @@ void DT_Server_Cmd_Init(Server_Cmd_t * Server_Cmd)
 {
        DT_dapltest_debug = 0;
        Server_Cmd->debug = false;
+       Server_Cmd->port = SERVER_PORT_NUMBER;
        Server_Cmd->dapl_name[0] = '\0';
        Server_Cmd->ReliabilityLevel = DAT_QOS_BEST_EFFORT;
 }
@@ -44,7 +45,7 @@ DT_Server_Cmd_Parse(Server_Cmd_t * Server_Cmd,
 {
        int c;
        for (;;) {
-               c = DT_mygetopt_r(my_argc, my_argv, "dD:R:", opts);
+               c = DT_mygetopt_r(my_argc, my_argv, "dD:R:n:", opts);
                if (c == EOF) {
                        break;
                }
@@ -69,6 +70,11 @@ DT_Server_Cmd_Parse(Server_Cmd_t * Server_Cmd,
                                }
                                break;
                        }
+               case 'n':
+                       {
+                               Server_Cmd->port = atoi(opts->optarg);
+                               break;
+                       }
                case '?':
                default:
                        {
@@ -96,8 +102,8 @@ void DT_Server_Cmd_Usage(void)
        DT_Mdep_printf("USAGE:              [-D <device Name>]\n");
        DT_Mdep_printf("USAGE:              [-d] : debug (zero)\n");
        DT_Mdep_printf("USAGE:              [-R <service reliability>]\n");
-       DT_Mdep_printf
-           ("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
+       DT_Mdep_printf("USAGE:              [-n <server port number>]\n");
+       DT_Mdep_printf("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
        DT_Mdep_printf("USAGE:                  (HT == QOS_HIGH_THROUGHPUT)\n");
        DT_Mdep_printf("USAGE:                  (LL == QOS_LOW_LATENCY)\n");
        DT_Mdep_printf("USAGE:                  (EC == QOS_ECONOMY)\n");
@@ -111,4 +117,5 @@ void DT_Server_Cmd_Print(Server_Cmd_t * Server_Cmd)
 {
        DT_Mdep_printf("Server_Cmd.debug:       %d\n", Server_Cmd->debug);
        DT_Mdep_printf("Server_Cmd.dapl_name: %s\n", Server_Cmd->dapl_name);
+       DT_Mdep_printf("Server_Cmd.port:       %d\n", Server_Cmd->port);
 }
index 5bdcab8cfea5d8304cf0132572d7202894d52d73..80b493d81eb4560eff69956652af93084825ee5b 100644 (file)
@@ -192,18 +192,16 @@ static void DT_Transaction_Cmd_Usage(void)
        DT_Mdep_printf("USAGE:     dapltest -T T\n");
        DT_Mdep_printf("USAGE:              -s <server Name>\n");
        DT_Mdep_printf("USAGE:              [-D <device Name>]\n");
+       DT_Mdep_printf("USAGE:              [-n <server port number>]\n");
        DT_Mdep_printf("USAGE:              [-d] : debug (zero)\n");
-       DT_Mdep_printf
-           ("USAGE:              [-i <num iterations>]     : (1, 000)\n");
+       DT_Mdep_printf("USAGE:              [-i <num iterations>]     : (1, 000)\n");
        DT_Mdep_printf("USAGE:              [-t <num threads>]        : (1)\n");
        DT_Mdep_printf("USAGE:              [-w <num EPs per thread>] : (1)\n");
        DT_Mdep_printf("USAGE:              [-V ] : Validate data: (false)\n");
-       DT_Mdep_printf
-           ("USAGE:              [-P ] : DTO Completion Polling: (false)\n");
+       DT_Mdep_printf("USAGE:              [-P ] : DTO Completion Polling: (false)\n");
        DT_Mdep_printf("USAGE:              [-r ] : Use RSPs: (false)\n");
        DT_Mdep_printf("USAGE:              [-R <service reliability>]\n");
-       DT_Mdep_printf
-           ("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
+       DT_Mdep_printf("USAGE:                  (BE == QOS_BEST_EFFORT - Default)\n");
        DT_Mdep_printf("USAGE:                  (HT == QOS_HIGH_THROUGHPUT)\n");
        DT_Mdep_printf("USAGE:                  (LL == QOS_LOW_LATENCY)\n");
        DT_Mdep_printf("USAGE:                  (EC == QOS_ECONOMY)\n");
@@ -216,16 +214,12 @@ static void DT_Transaction_Cmd_Usage(void)
        DT_Mdep_printf("USAGE:                     : \"RR\" (RDMA READ)\n");
        DT_Mdep_printf("USAGE:                     : \"RW\" (RDMA WRITE)\n");
        DT_Mdep_printf("USAGE:     [seg_size [num_segs] ]      : (4096, 1)\n");
-       DT_Mdep_printf
-           ("USAGE:     [-f]                 : Reap sends on recv\n");
+       DT_Mdep_printf("USAGE:     [-f]                 : Reap sends on recv\n");
        DT_Mdep_printf("USAGE:\n");
        DT_Mdep_printf("NOTE: -f is only allowed on \"SR\" OPs\n");
-       DT_Mdep_printf
-           ("NOTE: -f must appear in pairs (one client, one server)\n");
-       DT_Mdep_printf
-           ("NOTE: At least one server SR and one client SR OP are required\n");
-       DT_Mdep_printf
-           ("NOTE: and use of -V results in the use of three extra OPs\n");
+       DT_Mdep_printf("NOTE: -f must appear in pairs (one client, one server)\n");
+       DT_Mdep_printf("NOTE: At least one server SR and one client SR OP are required\n");
+       DT_Mdep_printf("NOTE: and use of -V results in the use of three extra OPs\n");
 }
 
 void DT_Transaction_Cmd_Init(Transaction_Cmd_t * cmd)
@@ -238,6 +232,7 @@ void DT_Transaction_Cmd_Init(Transaction_Cmd_t * cmd)
        cmd->eps_per_thread = 1;
        cmd->debug = false;
        cmd->validate = false;
+       cmd->port = SERVER_PORT_NUMBER;
        cmd->ReliabilityLevel = DAT_QOS_BEST_EFFORT;
 }
 
@@ -250,7 +245,7 @@ DT_Transaction_Cmd_Parse(Transaction_Cmd_t * cmd,
        int i;
        char op[100];
        for (;;) {
-               c = DT_mygetopt_r(my_argc, my_argv, "rQVPdw:s:D:i:t:v:R:",
+               c = DT_mygetopt_r(my_argc, my_argv, "rQVPdw:s:D:i:t:v:R:n:",
                                  opts);
                if (c == EOF) {
                        break;
@@ -339,6 +334,11 @@ DT_Transaction_Cmd_Parse(Transaction_Cmd_t * cmd,
                                    DT_ParseQoS(opts->optarg);
                                break;
                        }
+               case 'n':
+                       {
+                               cmd->port = atoi(opts->optarg);
+                               break;
+                       }
                case '?':
                default:
                        {
@@ -422,6 +422,8 @@ void DT_Transaction_Cmd_Print(Transaction_Cmd_t * cmd)
        DT_Mdep_printf("-------------------------------------\n");
        DT_Mdep_printf("TransCmd.server_name              : %s\n",
                       cmd->server_name);
+       DT_Mdep_printf("TransCmd.server_port_number       : %d\n",
+                      cmd->port);
        DT_Mdep_printf("TransCmd.num_iterations           : %d\n",
                       cmd->num_iterations);
        DT_Mdep_printf("TransCmd.num_threads              : %d\n",
index df3e000940921cedc8ded6b57afb7558dae9d8c7..a514973a0efe13a873d78ec086e3b4b9f5cc31cb 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "dapl_proto.h"
 
+#define SERVER_PORT_NUMBER ((DAT_CONN_QUAL)0xB0de)
+
 typedef enum
 {
     RDMA_READ,
index 0989a2e708f9a0d50358de10b3637d83fdc6180b..adfee7a3b4f27dd501feeba953daa1182f8e6940 100644 (file)
@@ -67,6 +67,7 @@ typedef struct
     int                num_threads;    //-t
     int                num_vis;        //-v
     DAT_QOS            ReliabilityLevel;       //-R
+    DAT_CONN_QUAL      port;           /* -n */
 } FFT_Cmd_t;
 
 #endif
index 03bc77398aa41563b0ec1f5caacdc69eefe9bc29..ceb53e834ec66f52bb87970945decf5faea59008 100644 (file)
@@ -62,6 +62,7 @@ typedef struct
     DAT_UINT32         debug;                  /* -d */
     DAT_UINT32         maximum;                /* -m */
     DAT_UINT32                 Test_List[ LIM_NUM_TESTS ];
+    DAT_CONN_QUAL      port;                   /* -n */
 } Limit_Cmd_t;
 
 #pragma pack ()
index dc500b787064c58fe166a36d6daa84ec6c1c8931..bac65b094705da029650f97cc807eb01799ae806 100644 (file)
@@ -70,6 +70,7 @@ typedef struct
     bool           local_is_little_endian;
     bool           debug;
     double         cpu_mhz;
+    int                    server_port;
 } Params_t;
 
 #endif
index 93fb3215ff05355e9e908500397ea0ea3176cfae..ad6fc1fdd76a735a6bb96b028708fb08ec393d7f 100644 (file)
@@ -62,6 +62,7 @@ typedef struct
     DAT_UINT32                 pipeline_len;           /* -p */
     Performance_Cmd_Op_t       op;
     DAT_UINT32                 use_rsp;                /* -r */
+    DAT_CONN_QUAL                      port;                   /* -n */
 
 } Performance_Cmd_t;
 #pragma pack ()
index 244103a88075ece6938085761728304c7f79eca4..ee39ddf8cf6f035f2272b1e407fcc1180b3e0340 100644 (file)
@@ -38,6 +38,7 @@ typedef struct
     bool            debug;             /* -d */
     char            dapl_name[256];    /* -D device name */
     DAT_QOS         ReliabilityLevel;  /* -R */
+    DAT_CONN_QUAL   port;              /* -n */
 } Server_Cmd_t;
 #pragma pack ()
 
index 898f9cc4090188f1bfa0f61e9240bb6326b677dc..f3865ebd9ec5306e9317ef7eae810470d102f3d1 100644 (file)
@@ -45,8 +45,6 @@ typedef struct started_server Started_server_t;
 
 extern Started_server_t *DT_started_server_list;
 
-#define SERVER_PORT_NUMBER ((DAT_CONN_QUAL)0xB0de)
-
 typedef struct
 {
     DAT_UINT32      dapltest_version;
index afd59c017dadbea348a880ac0215c83017397d5b..6801af4a2e63d71306d4e28e6552d19f22feba27 100644 (file)
@@ -59,11 +59,12 @@ typedef struct
     DAT_UINT32      debug;             /* -d */
     DAT_UINT32      validate;          /* -V */
     DAT_UINT32      poll;              /* -P */
+    DAT_CONN_QUAL   port;              /* -n */
     char            dapl_name[NAME_SZ]; /* -D */
     DAT_QOS         ReliabilityLevel;
     DAT_UINT32      num_ops;
     Transaction_Cmd_Op_t op[MAX_OPS];
-} Transaction_Cmd_t;
+ } Transaction_Cmd_t;
 #pragma pack ()
 
 #endif
index 91ebd7dc4e0554ac6f820c154e24a8e585b92885..21c6e018fc2ec29024ccb6ec21879f1feb2d783f 100644 (file)
@@ -215,7 +215,7 @@ DT_cs_Client(Params_t * params_ptr,
 
        DT_Tdep_PT_Debug(1, (phead, "%s: Connect Endpoint\n", module));
       retry:
-       ret = dat_ep_connect(ep_handle, server_netaddr, SERVER_PORT_NUMBER, DAT_TIMEOUT_INFINITE, 0, (DAT_PVOID) 0,     /* no private data */
+       ret = dat_ep_connect(ep_handle, server_netaddr, params_ptr->server_port, DAT_TIMEOUT_INFINITE, 0, (DAT_PVOID) 0,        /* no private data */
                             params_ptr->ReliabilityLevel,
                             DAT_CONNECT_DEFAULT_FLAG);
        if (ret != DAT_SUCCESS) {
index 5bbee36fc9fcdb6f1c01e5398d61d03cae8a0067..777315fab0fc574726ef45b7aa0f605df7ca24a6 100644 (file)
@@ -227,7 +227,7 @@ int DT_queryinfo_basic(Params_t * params_ptr,
        /* Test dat_psp_query function */
        else if (object_to_query == QUERY_PSP) {
                rc = dat_psp_create(ia_handle,
-                                   SERVER_PORT_NUMBER,
+                                   params_ptr->server_port,
                                    cr_evd_handle,
                                    DAT_PSP_PROVIDER_FLAG, &psp_handle);
                DT_assert_dat(phead, rc == DAT_SUCCESS);
@@ -245,7 +245,7 @@ int DT_queryinfo_basic(Params_t * params_ptr,
        /* Test dat_rsp_query function */
        else if (object_to_query == QUERY_RSP) {
                rc = dat_rsp_create(ia_handle,
-                                   SERVER_PORT_NUMBER,
+                                   params_ptr->server_port,
                                    ep_handle, cr_evd_handle, &rsp_handle);
                DT_assert_dat(phead, rc == DAT_SUCCESS);
                rc = dat_rsp_query(rsp_handle, DAT_RSP_FIELD_ALL, &rsp_param);
index eeb3299854afbf8f42886d6f4056b50ab1c83166..5afd9fb058773edce05da4957965d7f3a6f02382 100644 (file)
@@ -274,7 +274,7 @@ void DT_fft_init_server(Params_t * params_ptr, FFT_Cmd_t * cmd,
        DT_assert_dat(phead, rc == DAT_SUCCESS);
 
        /* create a PSP */
-       rc = dat_psp_create(conn->ia_handle, SERVER_PORT_NUMBER, conn->cr_evd,
+       rc = dat_psp_create(conn->ia_handle, params_ptr->server_port, conn->cr_evd,
                            DAT_PSP_CONSUMER_FLAG, &conn->psp_handle);
        DT_assert_dat(phead, rc == DAT_SUCCESS);
 
@@ -299,7 +299,7 @@ void DT_fft_listen(Params_t * params_ptr, FFT_Connection_t * conn)
        DT_assert_dat(phead,
                      DT_cr_event_wait(phead, conn->cr_evd, &conn->cr_stat)
                      && DT_cr_check(phead, &conn->cr_stat, conn->psp_handle,
-                                    SERVER_PORT_NUMBER, &conn->cr_handle,
+                                     params_ptr->server_port, &conn->cr_handle,
                                     "DT_fft_listen"));
 
        /* accept the connection */
@@ -332,7 +332,7 @@ int DT_fft_connect(Params_t * params_ptr, FFT_Connection_t * conn)
 
                /* attempt to connect, timeout = 10 secs */
                rc = dat_ep_connect(conn->ep_handle, conn->remote_netaddr,
-                                   SERVER_PORT_NUMBER, 10 * 1000000, 0,
+                                   params_ptr->server_port, 10 * 1000000, 0,
                                    (DAT_PVOID) 0, DAT_QOS_BEST_EFFORT,
                                    DAT_CONNECT_DEFAULT_FLAG);
                DT_assert_dat(phead, rc == DAT_SUCCESS);
index 92e0d21e7f5d8f16df87c935e57ea04a99312184..88b74d97d048c7972dc0c7e9c671b431e2b4ce26 100644 (file)
@@ -97,7 +97,7 @@ void DT_cs_Server(Params_t * params_ptr)
                goto server_exit;
        }
        DT_Mdep_LockInit(&ps_ptr->num_clients_lock);
-       ps_ptr->NextPortNumber = SERVER_PORT_NUMBER + 1;
+       ps_ptr->NextPortNumber = params_ptr->server_port + 1;
        ps_ptr->num_clients = 0;
 
        /* Open the IA */
@@ -191,7 +191,7 @@ void DT_cs_Server(Params_t * params_ptr)
 
        /* Create PSP */
        ret = dat_psp_create(ps_ptr->ia_handle,
-                            SERVER_PORT_NUMBER,
+                            params_ptr->server_port,
                             ps_ptr->creq_evd_hdl,
                             DAT_PSP_CONSUMER_FLAG, &ps_ptr->psp_handle);
        if (ret != DAT_SUCCESS) {
@@ -303,7 +303,7 @@ void DT_cs_Server(Params_t * params_ptr)
                                  module));
                if (!DT_cr_event_wait(phead, ps_ptr->creq_evd_hdl, &cr_stat)
                    || !DT_cr_check(phead, &cr_stat, ps_ptr->psp_handle,
-                                   SERVER_PORT_NUMBER, &cr_handle, module)) {
+                                   params_ptr->server_port, &cr_handle, module)) {
 
                        DT_Tdep_PT_Printf(phead,
                                          "CR Check failed, file %s line %d\n",
@@ -434,8 +434,8 @@ void DT_cs_Server(Params_t * params_ptr)
                pt_ptr->Server_Info.is_little_endian =
                    DT_local_is_little_endian;
                /* reset port, don't eat up port space on long runs */
-               if (ps_ptr->NextPortNumber >= SERVER_PORT_NUMBER + 1000)
-                       ps_ptr->NextPortNumber = SERVER_PORT_NUMBER + 1;
+               if (ps_ptr->NextPortNumber >= params_ptr->server_port + 1000)
+                       ps_ptr->NextPortNumber = params_ptr->server_port + 1;
                pt_ptr->Server_Info.first_port_number = ps_ptr->NextPortNumber;
                ps_ptr->NextPortNumber += pt_ptr->Client_Info.total_threads;