From 4c084a67e69d4c863e64bc38d5d6109a328b85da Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 8 Nov 2010 11:07:14 -0500 Subject: [PATCH] rxperf: use parallel connections When the number of threads exceeds RX_MAXCALLS allocate additional rx connection objects. Reviewed-on: http://gerrit.openafs.org/3285 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit df682aa34170d285247c5486050db3ee7d3774f0) Change-Id: Ia699fe0230e6dde2bc1f270d766f512f2693c94f Reviewed-on: http://gerrit.openafs.org/8421 Reviewed-by: Derrick Brashear Tested-by: BuildBot Tested-by: Stephan Wiesand Reviewed-by: Stephan Wiesand --- src/rx/test/rxperf.c | 46 +++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/rx/test/rxperf.c b/src/rx/test/rxperf.c index 3ab7b768b5..3f4a918f0f 100644 --- a/src/rx/test/rxperf.c +++ b/src/rx/test/rxperf.c @@ -832,23 +832,6 @@ do_client(const char *server, short port, char *filename, afs_int32 command, get_sec(0, &secureobj, &secureindex); - conn = rx_NewConnection(addr, htons(port), RX_SERVER_ID, secureobj, secureindex); - if (conn == NULL) - errx(1, "failed to contact server"); - -#ifdef AFS_PTHREAD_ENV - pthread_attr_init(&tattr); - pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_JOINABLE); -#endif - - params->conn = conn; - params->filename = filename; - params->command = command; - params->times = times; - params->bytes = bytes; - params->sendbytes = sendbytes; - params->readbytes = readbytes; - switch (command) { case RX_PERF_RPC: sprintf(stamp, "RPC: threads\t%d, times\t%d, write bytes\t%d, read bytes\t%d", @@ -868,11 +851,38 @@ do_client(const char *server, short port, char *filename, afs_int32 command, break; } + conn = rx_NewConnection(addr, htons(port), RX_SERVER_ID, secureobj, secureindex); + if (conn == NULL) + errx(1, "failed to contact server"); + +#ifdef AFS_PTHREAD_ENV + pthread_attr_init(&tattr); + pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_JOINABLE); +#endif + + params->conn = conn; + params->filename = filename; + params->command = command; + params->times = times; + params->bytes = bytes; + params->sendbytes = sendbytes; + params->readbytes = readbytes; + start_timer(); #ifdef AFS_PTHREAD_ENV - for ( i=0; iconn = conn; + params = new_params; + } + } + } #else client_thread(params); #endif