[ewg] [PATCH] Perftest: Add qp_timeout option

orenmeron orenmeron at dev.mellanox.co.il
Mon May 25 09:48:05 PDT 2009


commit 1cd38e844dc50d670b48200bcda91937df5f5a92
Author: Oren Meron <orenmeron at mtlsws18.lab.mtl.com>
Date:   Mon May 25 19:28:21 2009 +0300

    Perftest: Add qp_timeout option

    Signed-off-by: Oren Meron <orenmeron at dev.mellanox.co.il>

diff --git a/read_bw.c b/read_bw.c
index c470e59..8c3d553 100755
--- a/read_bw.c
+++ b/read_bw.c
@@ -69,6 +69,7 @@ struct user_parameters {
        int tx_depth;
        int max_out_read;
        int use_event;
+       int qp_timeout;
 };
 static int page_size;
 cycles_t       *tposted;
@@ -434,7 +435,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                fprintf(stderr, "Failed to modify RC QP to RTR\n");
                return 1;
        }
-       attr.timeout            = 14;
+       attr.timeout            = user_parm->qp_timeout;
        attr.retry_cnt          = 7;
        attr.rnr_retry          = 7;
        attr.qp_state       = IBV_QPS_RTS;
@@ -469,6 +470,7 @@ static void usage(const char *argv0)
        printf("  -a, --all              Run sizes from 2 till 2^23\n");
        printf("  -t, --tx-depth=<dep>   size of tx queue (default 100)\n");
        printf("  -n, --iters=<iters>    number of exchanges (at least 2, default 1000)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -b, --bidirectional    measure bidirectional bandwidth (default unidirectional)\n");
        printf("  -V, --version          display version number\n");
        printf("  -e, --events           sleep on CQ events (default poll)\n");
@@ -613,6 +615,7 @@ int main(int argc, char *argv[])
        user_param.servername = NULL;
        user_param.use_event = 0;
        user_param.max_out_read = 4; /* the device capability on gen2 */
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -626,6 +629,7 @@ int main(int argc, char *argv[])
                        { .name = "size",           .has_arg = 1, .val = 's' },
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "bidirectional",  .has_arg = 0, .val = 'b' },
                        { .name = "version",        .has_arg = 0, .val = 'V' },
@@ -634,7 +638,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:d:i:m:o:s:n:t:abVeF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:d:i:m:o:s:n:t:u:abVeF", long_options, NULL);
                if (c == -1)
                        break;

@@ -704,6 +708,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 1;
diff --git a/read_lat.c b/read_lat.c
index fb78f79..49f28cf 100755
--- a/read_lat.c
+++ b/read_lat.c
@@ -72,6 +72,7 @@ struct user_parameters {
        int sockfd;
        int max_out_read;
        int use_event;
+       int qp_timeout;

 };
 struct report_options {
@@ -457,7 +458,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                fprintf(stderr, "Failed to modify RC QP to RTR\n");
                return 1;
        }
-       attr.timeout            = 14;
+       attr.timeout            = user_parm->qp_timeout;
        attr.retry_cnt          = 7;
        attr.rnr_retry          = 7;
        attr.qp_state           = IBV_QPS_RTS;
@@ -561,6 +562,7 @@ static void usage(const char *argv0)
        printf("  -t, --tx-depth=<dep>         size of tx queue (default 50)\n");
        printf("  -n, --iters=<iters>          number of exchanges (at least 2, default 1000)\n");
        printf("  -o, --outs=<num>             num of outstanding read/atom(default 4)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -a, --all                    Run sizes from 2 till 2^23\n");
        printf("  -C, --report-cycles          report times in cpu cycle units (default microseconds)\n");
        printf("  -H, --report-histogram       print out all results (default print summary only)\n");
@@ -749,6 +751,7 @@ int main(int argc, char *argv[])
        user_param.servername = NULL;
        user_param.use_event = 0;
        user_param.max_out_read = 4; /* the device capability on gen2 */
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -763,6 +766,7 @@ int main(int argc, char *argv[])
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "outs",           .has_arg = 1, .val = 'o' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "report-cycles",  .has_arg = 0, .val = 'C' },
                        { .name = "report-histogram",.has_arg = 0, .val = 'H' },
@@ -773,7 +777,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:c:m:d:i:s:o:n:t:aeHUVF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:c:m:d:i:s:o:n:t:u:aeHUVF", long_options, NULL);
                if (c == -1)
                        break;

@@ -858,6 +862,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 5;
diff --git a/send_bw.c b/send_bw.c
index fdb88a1..a04703c 100755
--- a/send_bw.c
+++ b/send_bw.c
@@ -82,6 +82,7 @@ struct user_parameters {
        int use_event;
        int use_mcg;
        int inline_size;
+       int qp_timeout;
 };
 static int page_size;
 cycles_t       *tposted;
@@ -531,7 +532,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                        fprintf(stderr, "Failed to modify RC QP to RTR\n");
                        return 1;
                }
-               attr.timeout            = 14;
+               attr.timeout            = user_parm->qp_timeout;
                attr.retry_cnt          = 7;
                attr.rnr_retry          = 7;
        } else if (user_parm->connection_type == UC) {
@@ -627,6 +628,7 @@ static void usage(const char *argv0)
        printf("  -r, --rx-depth=<dep>        make rx queue bigger than tx (default 600)\n");
        printf("  -n, --iters=<iters>         number of exchanges (at least 2, default 1000)\n");
        printf("  -I, --inline_size=<size>    max size of message to be sent in inline mode (default 400)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -b, --bidirectional         measure bidirectional bandwidth (default unidirectional)\n");
        printf("  -V, --version               display version number\n");
        printf("  -e, --events                sleep on CQ events (default poll)\n");
@@ -951,6 +953,7 @@ int main(int argc, char *argv[])
        user_param.use_event = 0;
        user_param.duplex = 0;
        user_param.inline_size = MAX_INLINE;
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -966,6 +969,7 @@ int main(int argc, char *argv[])
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
                        { .name = "inline_size",    .has_arg = 1, .val = 'I' },
                        { .name = "rx-depth",       .has_arg = 1, .val = 'r' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "bidirectional",  .has_arg = 0, .val = 'b' },
                        { .name = "version",        .has_arg = 0, .val = 'V' },
@@ -976,7 +980,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:d:i:m:c:s:n:t:I:r:ebaVgNF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:d:i:m:c:s:n:t:I:r:u:ebaVgNF", long_options, NULL);
                if (c == -1)
                        break;

@@ -1070,6 +1074,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 1;
diff --git a/send_lat.c b/send_lat.c
index 3bbc3d1..d3b884a 100755
--- a/send_lat.c
+++ b/send_lat.c
@@ -79,6 +79,7 @@ struct user_parameters {
        int use_event;
        int inline_size;
        int use_mcg;
+       int qp_timeout;
 };

 struct report_options {
@@ -552,7 +553,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                        fprintf(stderr, "Failed to modify RC QP to RTR\n");
                        return 1;
                }
-               attr.timeout            = 14;
+               attr.timeout            = user_parm->qp_timeout;
                attr.retry_cnt          = 7;
                attr.rnr_retry          = 7;
        } else if (user_parm->connection_type==UC) {
@@ -709,6 +710,7 @@ static void usage(const char *argv0)
        printf("  -a, --all                    Run sizes from 2 till 2^23\n");
        printf("  -n, --iters=<iters>          number of exchanges (at least 2, default 1000)\n");
        printf("  -I, --inline_size=<size>     max size of message to be sent in inline mode (default 400)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -C, --report-cycles          report times in cpu cycle units (default microseconds)\n");
        printf("  -H, --report-histogram       print out all results (default print summary only)\n");
        printf("  -U, --report-unsorted        (implies -H) print out unsorted results (default sorted)\n");
@@ -1005,6 +1007,7 @@ int main(int argc, char *argv[])
        user_param.use_mcg = 0;
        user_param.inline_size = MAX_INLINE;
        user_param.signal_comp = 0;
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -1019,6 +1022,7 @@ int main(int argc, char *argv[])
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
                        { .name = "inline_size",    .has_arg = 1, .val = 'I' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "signal",         .has_arg = 0, .val = 'l' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "report-cycles",  .has_arg = 0, .val = 'C' },
@@ -1030,7 +1034,7 @@ int main(int argc, char *argv[])
                        { .name = "CPU-freq",       .has_arg = 0, .val = 'F' },
                        { 0 }
                };
-               c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:laeCHUVgF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:u:laeCHUVgF", long_options, NULL);
                if (c == -1)
                        break;

@@ -1127,6 +1131,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 5;
diff --git a/write_bw.c b/write_bw.c
index cad6dee..683fb80 100755
--- a/write_bw.c
+++ b/write_bw.c
@@ -73,6 +73,7 @@ struct user_parameters {
     int numofqps;
     int maxpostsofqpiniteration;
     int inline_size;
+       int qp_timeout;
 };
 struct extended_qp {
   struct ibv_qp           *qp;
@@ -458,7 +459,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                        fprintf(stderr, "Failed to modify RC QP to RTR\n");
                        return 1;
                }
-               attr.timeout            = 14;
+               attr.timeout            = user_parm->qp_timeout;
                attr.retry_cnt          = 7;
                attr.rnr_retry          = 7;
        } else {
@@ -519,6 +520,7 @@ static void usage(const char *argv0)
        printf("  -t, --tx-depth=<dep>      size of tx queue (default 100)\n");
        printf("  -n, --iters=<iters>       number of exchanges (at least 2, default 5000)\n");
        printf("  -I, --inline_size=<size>  max size of message to be sent in inline mode (default 400)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -b, --bidirectional       measure bidirectional bandwidth (default unidirectional)\n");
        printf("  -V, --version             display version number\n");
        printf("  -N, --no peak-bw          cancel peak-bw calculation (default with peak-bw)\n");
@@ -692,6 +694,7 @@ int main(int argc, char *argv[])
        user_param.numofqps = 1;
        user_param.maxpostsofqpiniteration = 100;
        user_param.inline_size = MAX_INLINE;
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -708,6 +711,7 @@ int main(int argc, char *argv[])
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
                        { .name = "inline_size",    .has_arg = 1, .val = 'I' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "bidirectional",  .has_arg = 0, .val = 'b' },
                        { .name = "version",        .has_arg = 0, .val = 'V' },
@@ -716,7 +720,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:baVNF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:u:baVNF", long_options, NULL);
                if (c == -1)
                        break;

@@ -804,6 +808,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 1;
diff --git a/write_bw_postlist.c b/write_bw_postlist.c
index 285e5ab..d9e8dc2 100755
--- a/write_bw_postlist.c
+++ b/write_bw_postlist.c
@@ -73,6 +73,7 @@ struct user_parameters {
     int numofqps;
     int maxpostsofqpiniteration;
     int inline_size;
+       int qp_timeout;
 };
 struct extended_qp {
   struct ibv_qp           *qp;
@@ -458,7 +459,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                        fprintf(stderr, "Failed to modify RC QP to RTR\n");
                        return 1;
                }
-               attr.timeout            = 14;
+               attr.timeout            = user_parm->qp_timeout;
                attr.retry_cnt          = 7;
                attr.rnr_retry          = 7;
        } else {
@@ -519,6 +520,7 @@ static void usage(const char *argv0)
        printf("  -t, --tx-depth=<dep>      size of tx queue (default 100)\n");
        printf("  -n, --iters=<iters>       number of exchanges (at least 2, default 5000)\n");
        printf("  -I, --inline_size=<size>  max size of message to be sent in inline mode (default 400)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -b, --bidirectional       measure bidirectional bandwidth (default unidirectional)\n");
        printf("  -V, --version             display version number\n");
        printf("  -F, --CPU-freq            do not fail even if cpufreq_ondemand module is loaded\n");
@@ -690,6 +692,7 @@ int main(int argc, char *argv[])
        user_param.numofqps = 1;
        user_param.maxpostsofqpiniteration = 100;
        user_param.inline_size = MAX_INLINE;
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -706,6 +709,7 @@ int main(int argc, char *argv[])
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
                        { .name = "inline_size",    .has_arg = 1, .val = 'I' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "bidirectional",  .has_arg = 0, .val = 'b' },
                        { .name = "version",        .has_arg = 0, .val = 'V' },
@@ -713,7 +717,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:baVF", long_options, NULL);
+               c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:u:baVF", long_options, NULL);
                if (c == -1)
                        break;

@@ -798,6 +802,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 1;
diff --git a/write_lat.c b/write_lat.c
index 6e1dcf9..819cf33 100755
--- a/write_lat.c
+++ b/write_lat.c
@@ -70,6 +70,7 @@ struct user_parameters {
        int iters;
        int tx_depth;
        int inline_size;
+       int qp_timeout;
 };
 struct report_options {
        int unsorted;
@@ -454,7 +455,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
                        fprintf(stderr, "Failed to modify RC QP to RTR\n");
                        return 1;
                }
-               attr.timeout            = 14;
+               attr.timeout            = user_parm->qp_timeout;
                attr.retry_cnt          = 7;
                attr.rnr_retry          = 7;
        } else {
@@ -577,6 +578,7 @@ static void usage(const char *argv0)
        printf("  -t, --tx-depth=<dep>         size of tx queue (default 50)\n");
        printf("  -n, --iters=<iters>          number of exchanges (at least 2, default 1000)\n");
        printf("  -I, --inline_size=<size>     max size of message to be sent in inline mode (default 400)\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
+       printf("  -u, --qp-timeout=<timeout> QP timeout, timeout value is 4 usec * 2 ^(timeout), default 14\n");
        printf("  -C, --report-cycles          report times in cpu cycle units (default microseconds)\n");
        printf("  -H, --report-histogram       print out all results (default print summary only)\n");
        printf("  -U, --report-unsorted        (implies -H) print out unsorted results (default sorted)\n");
@@ -771,6 +773,7 @@ int main(int argc, char *argv[])
        user_param.tx_depth = 50;
        user_param.servername = NULL;
        user_param.inline_size = MAX_INLINE;
+       user_param.qp_timeout = 14;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -785,6 +788,7 @@ int main(int argc, char *argv[])
                        { .name = "iters",          .has_arg = 1, .val = 'n' },
                        { .name = "tx-depth",       .has_arg = 1, .val = 't' },
                        { .name = "inline_size",    .has_arg = 1, .val = 'I' },
+                       { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
                        { .name = "all",            .has_arg = 0, .val = 'a' },
                        { .name = "report-cycles",  .has_arg = 0, .val = 'C' },
                        { .name = "report-histogram",.has_arg = 0, .val = 'H' },
@@ -794,7 +798,7 @@ int main(int argc, char *argv[])
                        { 0 }
                };

-               c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:aCHUVF", long_options, NULL);///cpufreq
+               c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:u:aCHUVF", long_options, NULL);///cpufreq
                if (c == -1)
                        break;

@@ -880,6 +884,10 @@ int main(int argc, char *argv[])
                        no_cpu_freq_fail = 1;
                        break;

+               case 'u':
+                       user_param.qp_timeout = strtol(optarg, NULL, 0);
+                       break;
+
                default:
                        usage(argv[0]);
                        return 5;



More information about the ewg mailing list