]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[TOOLS] performance tests: changes for interoperability with Linux.
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Oct 2008 10:50:55 +0000 (10:50 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Oct 2008 10:50:55 +0000 (10:50 +0000)
The main problem was, that Linux stores values like qpn, psn, lid in little endian format, while Windows - in big endian one.

git-svn-id: svn://openib.tc.cornell.edu/gen1@1710 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/tools/perftests/user/perf_defs.h
trunk/tools/perftests/user/perf_utils.c
trunk/tools/perftests/user/read_bw/read_bw.c
trunk/tools/perftests/user/read_lat/read_lat.c
trunk/tools/perftests/user/send_bw/send_bw.c
trunk/tools/perftests/user/send_lat/send_lat.c
trunk/tools/perftests/user/write_bw/write_bw.c
trunk/tools/perftests/user/write_lat/write_lat.c

index 2b29ae15f406fd8042b18c0aa0c2ac2be668bdb3..e23705443331e38b7f82c4029071c3922e52fc2e 100644 (file)
@@ -54,7 +54,7 @@
 #include <iba/ib_al.h>
 
 #define KEY_MSG_SIZE (sizeof "0000:000000:000000:00000000:0000000000000000")
-#define KEY_PRINT_FMT "%04x:%06x:%06x:%08x:%x"
+#define KEY_PRINT_FMT "%04x:%06x:%06x:%08x:%016I64x"
 #define KEY_SCAN_FMT "%x:%x:%x:%x:%x"
 
 #define VERSION 2.0
index b2e747731c41216b874be5d1f6fdb8fc72399e61..e56f5ee7630a634c207ae2ee85f13102d78fec05 100644 (file)
@@ -76,8 +76,8 @@ static int pp_write_keys(SOCKET sockfd, const struct pingpong_dest *my_dest)
 {
        char msg[KEY_MSG_SIZE];
        PERF_ENTER;
-       sprintf(msg, KEY_PRINT_FMT,my_dest->lid, my_dest->qpn,
-               my_dest->psn, my_dest->rkey, my_dest->vaddr);
+       sprintf(msg, KEY_PRINT_FMT,cl_hton16(my_dest->lid), cl_hton32(my_dest->qpn), 
+               cl_hton32(my_dest->psn), cl_hton32(my_dest->rkey), my_dest->vaddr);
 
        if (send(sockfd, msg, sizeof msg,0) != sizeof msg) {
                perror("pp_write_keys");
@@ -101,8 +101,12 @@ static int pp_read_keys(SOCKET sockfd,
                return -1;
        }
        
-       parsed = sscanf(msg, KEY_SCAN_FMT, &rem_dest->lid, &rem_dest->qpn,
+       parsed = sscanf(msg, KEY_PRINT_FMT, &rem_dest->lid, &rem_dest->qpn,
                        &rem_dest->psn,&rem_dest->rkey, &rem_dest->vaddr);
+       rem_dest->lid = cl_ntoh16(rem_dest->lid);
+       rem_dest->qpn = cl_ntoh32(rem_dest->qpn);
+       rem_dest->psn = cl_ntoh32(rem_dest->psn);
+       rem_dest->rkey = cl_ntoh32(rem_dest->rkey);
 
        if (parsed != 5) {
                fprintf(stderr, "Couldn't parse line <%.*s > parsed = %d %s\n",
index e2bfd63051dec28f2b549a00a04c4d4392db7f4f..6637037fe85ad4b3cf41388af9ca495899904146 100644 (file)
@@ -399,7 +399,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;
index d34843212491f69669ea8a46b9e1868021c4fa39..0c15f83c97982ce03d2334e296b1ec92b036d9dc 100644 (file)
@@ -410,7 +410,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;
index 25e5201c2b020105a82aeb74cd9dfafea39be53b..ae12cde5bba26b71de9489dfdd2c240e9ac548a8 100644 (file)
@@ -502,7 +502,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;
@@ -606,16 +606,16 @@ int run_iter_bi(struct pingpong_context *ctx, struct user_parameters *user_param
        /*********************************************
         * Important note :
         * In case of UD/UC this is NOT the way to measure
-        * BW sicen we are running with loop on the send side
-        * while we should run on the recieve side or enable retry in SW
+        * BW since we are running with loop on the send side
+        * while we should run on the receive side or enable retry in SW
         * Since the sender may be faster than the reciver than although
         * we had posted recieve it is not enough and might end this will
         * result in deadlock of test since both sides are stuck on poll cq
         * In this test i do not solve this for the general test ,need to write
-        * seperate test for UC/UD but in case the tx_depth is ~1/3 from the
+        * separate test for UC/UD but in case the tx_depth is ~1/3 from the
         * number of iterations this should be ok .
         * Also note that the sender is limited in the number of send, ans
-        * i try to make the reciver full 
+        * i try to make the receiver full 
         *********************************************/
        /* send */
        if (user_param->connection_type==UD) {
index a78194f442533519bfecb4ecb11b2a0f57a658b0..7c7040843c111a8b052e29466f3f3782116a7579 100644 (file)
@@ -488,7 +488,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;
index 8ba5010a3a0b06ee16a9664b422ee4a97a88855e..c62ced1a30820b0a9ba68f1077a7abd0f244fcd5 100644 (file)
@@ -429,7 +429,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;
index 28d89a65ff1edb6b7ca4c1e9c7a780b7643b9252..5eb21afff1537142b99f535c4dcb7b1a2463ab4e 100644 (file)
@@ -419,7 +419,7 @@ static SOCKET pp_open_port(struct pingpong_context *ctx, const char * servername
                * We do it by exchanging data over a TCP socket connection. */
                
                my_dest[i].lid = ctx->ca_attr->p_port_attr[ib_port-1].lid;
-               my_dest[i].psn = rand() & 0xffffff;
+               my_dest[i].psn = cl_hton32(rand() & 0xffffff);
                if (!my_dest[i].lid) {
                        fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
                        return 1;