Hi,

We are testing QoS.
We have defined service level rules in opensm and implemented qos-policy.
Implementation wasn't fully done in perftest tools.

So, I've implemented pertest tools by adding -L option to set service levels.

I took OFED 1.3 git version. The lastest commit is :
commit 6321b5468f7293088cc003809049c02b176130d8
Author: Oren Meron <[EMAIL PROTECTED]>
Date:   Tue Apr 1 08:22:48 2008 +0000


The patch is below

---

Celine Bourde.
Signed-off-by: Celine Bourde <[EMAIL PROTECTED]>

rdma_bw.c           |   12 ++++++++++--
rdma_lat.c          |   14 +++++++++++---
read_bw.c           |   12 ++++++++++--
read_lat.c          |   12 ++++++++++--
send_bw.c           |   12 ++++++++++--
send_lat.c          |   12 ++++++++++--
write_bw.c          |   12 ++++++++++--
write_bw_postlist.c |   12 ++++++++++--
write_lat.c         |   12 ++++++++++--
9 files changed, 91 insertions(+), 19 deletions(-)

diff --git a/rdma_bw.c b/rdma_bw.c
index d27a87f..029dc1a 100755
--- a/rdma_bw.c
+++ b/rdma_bw.c
@@ -92,6 +92,7 @@ struct pp_data {
 	int                 		tx_depth;
 	int				use_cma;
 	int 		    		sockfd;
+	int 				service_level;
 	char				*servername;
 	struct pingpong_dest		my_dest;
 	struct pingpong_dest 		*rem_dest;
@@ -651,7 +652,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, struct pp_data data)
 	attr.min_rnr_timer 	= 12;
 	attr.ah_attr.is_global  = 0;
 	attr.ah_attr.dlid       = data.rem_dest->lid;
-	attr.ah_attr.sl         = 0;
+	attr.ah_attr.sl         = data.service_level;
 	attr.ah_attr.src_path_bits = 0;
 	attr.ah_attr.port_num   = data.ib_port;
 	if (ibv_modify_qp(ctx->qp, &attr,
@@ -860,6 +861,7 @@ static void usage(const char *argv0)
 	printf("  -n, --iters=<iters>    number of exchanges (at least 2, default 1000)\n");
 	printf("  -b, --bidirectional    measure bidirectional bandwidth (default unidirectional)\n");
 	printf("  -c, --cma		 use RDMA CM\n");
+	printf("  -L, --service_level=<sl>  Service level for QoS (default 0)\n");
 }
 
 static void print_report(unsigned int iters, unsigned size, int duplex,
@@ -924,6 +926,7 @@ int main(int argc, char *argv[])
 		.size       = 65536,
 		.tx_depth   = 100,
 		.use_cma    = 0,
+		.service_level = 0,
 		.servername = NULL,
 		.rem_dest   = NULL,
 		.ib_dev     = NULL,
@@ -943,12 +946,13 @@ 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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "bidirectional",  .has_arg = 0, .val = 'b' },
 			{ .name = "cma", 	    .has_arg = 0, .val = 'c' },
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:s:n:t:bc", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:s:n:t:L:bc", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -985,6 +989,10 @@ int main(int argc, char *argv[])
 			data.tx_depth = strtol(optarg, NULL, 0);
 			if (data.tx_depth < 1) { usage(argv[0]); return 1; }
 			break;
+		
+		case 'L':
+			data.service_level = strtol(optarg, NULL, 0);
+			break;
 
 		case 'n':
 			iters = strtol(optarg, NULL, 0);
diff --git a/rdma_lat.c b/rdma_lat.c
index 6ade2b7..ec2c335 100755
--- a/rdma_lat.c
+++ b/rdma_lat.c
@@ -102,6 +102,7 @@ struct pp_data {
 	int                 		tx_depth;
 	int				use_cma;
 	int 		    		sockfd;
+	int 				service_level;
 	char				*servername;
 	struct pingpong_dest		my_dest;
 	struct pingpong_dest 		*rem_dest;
@@ -656,7 +657,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, struct pp_data *data)
 		.min_rnr_timer 	= 12,
 		.ah_attr.is_global  = 0,
 		.ah_attr.dlid       = data->rem_dest->lid,
-		.ah_attr.sl         = 0,
+		.ah_attr.sl         = data->service_level,
 		.ah_attr.src_path_bits = 0,
 		.ah_attr.port_num   = data->ib_port
 	};
@@ -922,6 +923,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("  -L, --service_level=<sl>  Service level for QoS (default 0)\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");
@@ -1025,6 +1027,7 @@ int main(int argc, char *argv[])
 		.size       = 1,
 		.tx_depth   = 50,
 		.use_cma    = 0,
+		.service_level = 0,
 		.servername = NULL,
 		.rem_dest   = NULL,
 		.ib_dev     = NULL,
@@ -1043,7 +1046,8 @@ 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 = "inline_size",     .has_arg = 1, .val = 'I' },
+			{ .name = "inline_size",    .has_arg = 1, .val = 'I' },
+			{ .name = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
 			{ .name = "report-histogram",.has_arg = 0, .val = 'H' },
 			{ .name = "report-unsorted",.has_arg = 0, .val = 'U' },
@@ -1051,7 +1055,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:s:n:t:I:CHUc", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:s:n:t:I:L:CHUc", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -1097,6 +1101,10 @@ int main(int argc, char *argv[])
 			case 'I':
 				inline_size = strtol(optarg, NULL, 0);
 				break;
+			
+			case 'L':
+				data.service_level = strtol(optarg, NULL, 0);
+				break;
 
 			case 'C':
 				report.cycles = 1;
diff --git a/read_bw.c b/read_bw.c
index 1501977..63e8676 100755
--- a/read_bw.c
+++ b/read_bw.c
@@ -67,6 +67,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int iters;
 	int tx_depth;
+	int service_level;
 	int max_out_read;
 	int use_event;
 };
@@ -420,7 +421,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 	attr.min_rnr_timer          = 12;
 	attr.ah_attr.is_global  = 0;
 	attr.ah_attr.dlid       = dest->lid;
-	attr.ah_attr.sl         = 0;
+	attr.ah_attr.sl         = user_parm->service_level;
 	attr.ah_attr.src_path_bits = 0;
 	attr.ah_attr.port_num   = port;
 	if (ibv_modify_qp(ctx->qp, &attr,
@@ -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("  -L, --service_level=<sl>  Service level for QoS (default 0)\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");
@@ -611,6 +613,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.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -624,6 +627,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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "bidirectional",  .has_arg = 0, .val = 'b' },
 			{ .name = "version",        .has_arg = 0, .val = 'V' },
@@ -631,7 +635,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:m:o:s:n:t:abVe", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:m:o:s:n:t:L:abVe", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -684,6 +688,10 @@ int main(int argc, char *argv[])
 			if (user_param.tx_depth < 1) { usage(argv[0]); return 1; }
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/read_lat.c b/read_lat.c
index 8119f57..73bcb7f 100755
--- a/read_lat.c
+++ b/read_lat.c
@@ -69,6 +69,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int iters;
 	int tx_depth;
+	int service_level;
 	int sockfd;
 	int max_out_read;
 	int use_event;
@@ -443,7 +444,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 	attr.min_rnr_timer          = 12;
 	attr.ah_attr.is_global      = 0;
 	attr.ah_attr.dlid           = dest->lid;
-	attr.ah_attr.sl             = 0;
+	attr.ah_attr.sl             = user_parm->service_level;
 	attr.ah_attr.src_path_bits  = 0;
 	attr.ah_attr.port_num       = port;
 	if (ibv_modify_qp(ctx->qp, &attr,
@@ -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("  -L, --service_level=<sl>  Service level for QoS (default 0)\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");
@@ -747,6 +749,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.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -761,6 +764,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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
 			{ .name = "report-histogram",.has_arg = 0, .val = 'H' },
@@ -770,7 +774,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:c:m:d:i:s:o:n:t:aeHUV", long_options, NULL);
+		c = getopt_long(argc, argv, "p:c:m:d:i:s:o:n:t:L:aeHUV", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -830,6 +834,10 @@ int main(int argc, char *argv[])
 			}
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/send_bw.c b/send_bw.c
index 541d7cf..3bc6a46 100755
--- a/send_bw.c
+++ b/send_bw.c
@@ -76,6 +76,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int signal_comp;
 	int iters;
+	int service_level;
 	int tx_depth;
 	int rx_depth;
 	int duplex;
@@ -502,7 +503,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 	}
 	attr.ah_attr.is_global  = 0;
 	attr.ah_attr.dlid       = dest->lid;
-	attr.ah_attr.sl         = 0;
+	attr.ah_attr.sl         = user_parm->service_level;
 	attr.ah_attr.src_path_bits = 0;
 	attr.ah_attr.port_num   = port;
 	if ((user_parm->connection_type==UD) && (user_parm->use_mcg)) {
@@ -626,6 +627,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("  -L, --service_level=<sl>     Service level for QoS (default 0)\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");
@@ -948,6 +950,7 @@ int main(int argc, char *argv[])
 	user_param.use_event = 0;
 	user_param.duplex = 0;
 	user_param.inline_size = MAX_INLINE;
+	user_param.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -963,6 +966,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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "bidirectional",  .has_arg = 0, .val = 'b' },
 			{ .name = "version",        .has_arg = 0, .val = 'V' },
@@ -972,7 +976,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:m:c:s:n:t:I:r:ebaVgN", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:m:c:s:n:t:I:r:L:ebaVgN", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -1045,6 +1049,10 @@ int main(int argc, char *argv[])
                         if (errno) { usage(argv[0]); return 1; }
                         break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/send_lat.c b/send_lat.c
index b2796d6..717bbcb 100755
--- a/send_lat.c
+++ b/send_lat.c
@@ -76,6 +76,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int iters;
 	int tx_depth;
+	int service_level;
 	int use_event;
 	int inline_size;
 	int use_mcg;
@@ -521,7 +522,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 
 	attr.ah_attr.is_global      = 0;
 	attr.ah_attr.dlid           = dest->lid;
-	attr.ah_attr.sl             = 0;
+	attr.ah_attr.sl             = user_parm->service_level;
 	attr.ah_attr.src_path_bits  = 0;
 	attr.ah_attr.port_num       = port;
 	if ((user_parm->connection_type==UD) && (user_parm->use_mcg)) {
@@ -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("  -L, --service_level=<sl>  Service level for QoS (default 0)\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");
@@ -1003,6 +1005,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.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -1017,6 +1020,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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "signal",         .has_arg = 0, .val = 'l' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
@@ -1027,7 +1031,7 @@ int main(int argc, char *argv[])
 			{ .name = "mcg",            .has_arg = 0, .val = 'g' },
 			{ 0 }
 		};
-		c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:laeCHUVg", long_options, NULL);
+		c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:L:laeCHUVg", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -1099,6 +1103,10 @@ int main(int argc, char *argv[])
 			}
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/write_bw.c b/write_bw.c
index ba51370..88eb21f 100755
--- a/write_bw.c
+++ b/write_bw.c
@@ -70,6 +70,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int iters;
 	int tx_depth;
+	int service_level;
     int numofqps;
     int maxpostsofqpiniteration;
     int inline_size;
@@ -443,7 +444,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 	}
 	attr.ah_attr.is_global  = 0;
 	attr.ah_attr.dlid       = dest->lid;
-	attr.ah_attr.sl         = 0;
+	attr.ah_attr.sl         = user_parm->service_level;
 	attr.ah_attr.src_path_bits = 0;
 	attr.ah_attr.port_num   = port;
 	if (user_parm->connection_type == RC) {
@@ -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("  -L, --service_level=<sl>  Service level for QoS (default 0)\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");
@@ -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.service_level = 0;
 	/* 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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .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:baVN", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:L:baVN", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -780,6 +784,10 @@ int main(int argc, char *argv[])
 			}
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/write_bw_postlist.c b/write_bw_postlist.c
index 87903c0..033e032 100755
--- a/write_bw_postlist.c
+++ b/write_bw_postlist.c
@@ -70,6 +70,7 @@ struct user_parameters {
 	int all; /* run all msg size */
 	int iters;
 	int tx_depth;
+	int service_level;
     int numofqps;
     int maxpostsofqpiniteration;
     int inline_size;
@@ -443,7 +444,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 	}
 	attr.ah_attr.is_global  = 0;
 	attr.ah_attr.dlid       = dest->lid;
-	attr.ah_attr.sl         = 0;
+	attr.ah_attr.sl         = user_parm->service_level;
 	attr.ah_attr.src_path_bits = 0;
 	attr.ah_attr.port_num   = port;
 	if (user_parm->connection_type == RC) {
@@ -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("  -L, --service_level=<sl>  Service level for QoS (default 0)\n");
 	printf("  -b, --bidirectional       measure bidirectional bandwidth (default unidirectional)\n");
 	printf("  -V, --version             display version number\n");
 }
@@ -688,6 +690,7 @@ int main(int argc, char *argv[])
 	user_param.numofqps = 1;
 	user_param.maxpostsofqpiniteration = 100;
 	user_param.inline_size = MAX_INLINE;
+	user_param.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -704,13 +707,14 @@ 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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "bidirectional",  .has_arg = 0, .val = 'b' },
 			{ .name = "version",        .has_arg = 0, .val = 'V' },
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:baV", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:L:baV", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -778,6 +782,10 @@ int main(int argc, char *argv[])
 
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
diff --git a/write_lat.c b/write_lat.c
index e71ce31..8a29409 100755
--- a/write_lat.c
+++ b/write_lat.c
@@ -68,6 +68,7 @@ struct user_parameters {
 	int mtu;
 	int all; /* run all msg size */
 	int iters;
+	int service_level;
 	int tx_depth;
 	int inline_size;
 };
@@ -438,7 +439,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx, int port, int my_psn,
 
 	attr.ah_attr.is_global      = 0;
 	attr.ah_attr.dlid           = dest->lid;
-	attr.ah_attr.sl             = 0;
+	attr.ah_attr.sl             = user_parm->service_level;
 	attr.ah_attr.src_path_bits  = 0;
 	attr.ah_attr.port_num       = port;
 
@@ -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("  -L, --service_level=<sl>     Service level for QoS (default 0)\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");
@@ -769,6 +771,7 @@ int main(int argc, char *argv[])
 	user_param.tx_depth = 50;
 	user_param.servername = NULL;
 	user_param.inline_size = MAX_INLINE;
+	user_param.service_level = 0;
 	/* Parameter parsing. */
 	while (1) {
 		int c;
@@ -783,6 +786,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 = "service_level",  .has_arg = 1, .val = 'L' },
 			{ .name = "all",            .has_arg = 0, .val = 'a' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
 			{ .name = "report-histogram",.has_arg = 0, .val = 'H' },
@@ -791,7 +795,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:aCHUV", long_options, NULL);
+		c = getopt_long(argc, argv, "p:c:m:d:i:s:n:t:I:L:aCHUV", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -852,6 +856,10 @@ int main(int argc, char *argv[])
 			}
 			break;
 
+		case 'L':
+			user_param.service_level = strtol(optarg, NULL, 0);
+			break;
+
 		case 'n':
 			user_param.iters = strtol(optarg, NULL, 0);
 			if (user_param.iters < 2) {
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to