dtest: the default size in pingpong test is set to 1 byte regardless to user input.
authorAmir Hanania <amir.hanania@intel.com>
Thu, 26 May 2016 21:14:11 +0000 (14:14 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Thu, 26 May 2016 21:14:11 +0000 (14:14 -0700)
Keep the user input if one provided.

Signed-off-by: Amir Hanania <amir.hanania@intel.com>
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
test/dtest/dtest.c

index 4d12d76..4d113c8 100755 (executable)
@@ -219,6 +219,7 @@ static int conn_poll_count = 0;
 static int rdma_rd_poll_count[MAX_RDMA_RD] = { 0 };
 static int delay = 0;
 static int buf_len = RDMA_BUFFER_SIZE;
+static int user_input_len = 0;
 static int buf_len_p2;
 static int use_cno = 0;
 static int recv_msg_index = 0;
@@ -625,6 +626,7 @@ int main(int argc, char **argv)
                        break;
                case 'b':
                        buf_len = atoi(optarg);
+                       user_input_len = 1;
                        break;
                case 'h':
                        server = 0;
@@ -696,9 +698,9 @@ int main(int argc, char **argv)
        fflush(stdout);
 
        if (write_only_pp) {
-               /* rdma write pingpong, default == 1 byte */
+               /* rdma write pingpong, set default to size to 1 byte unless specified by user */
                if (!all_data_sizes) {
-                       if (!data_check)
+                       if (!data_check && !user_input_len)
                                buf_len = 1;
                } else if (!increment) { /* power of 2 */
                        buf_len_p2 = 1;
@@ -914,7 +916,7 @@ int main(int argc, char **argv)
                                max = buf_len_p2;
                        }
                } else {
-                       if (data_check) {
+                       if (data_check || user_input_len) {
                                i = buf_len;
                                max = buf_len;
                                inc = 1;
@@ -926,8 +928,8 @@ int main(int argc, char **argv)
                                inc = buf_len;
                        }
                }
-               printf("\n %d RDMA WRITE PINGPONG %s\n\n", getpid(),
-                       data_check ? "with DATA CHECK":"");
+               printf("\n %d RDMA WRITE PINGPONG with%s DATA CHECK\n\n", getpid(),
+                       data_check ? "":"out");
 
                for (; i <= max; i++) {
                        if (all_data_sizes) {