[ewg] [PATCH ofed-1.3] rdma_lat: Add -m --max-inline option to support devices with different

Steve Wise swise at opengridcomputing.com
Mon Feb 4 08:08:41 PST 2008


Oren,

I have a small change to rdma_lat.c I'd like to get in ofed-1.3. It adds
a new option to allow specifying the max inline size, which is currently
hard-coded to 400.  400 is too big for chelsio devices. Adding a command
line option will allow the user to specify a different value.

Tziporet, can we pull this for ofed-1.3?

Thanks,

Steve.

--------------

rdma_lat: Add -m --max-inline option to support devices with different

inline max values.

Currently the max inline value is hard-coded and too big for the
chelsio device.  This patch allows specifying the max inline as a
command line param.

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---

 rdma_lat.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/rdma_lat.c b/rdma_lat.c
index 68c9120..f82cbcd 100755
--- a/rdma_lat.c
+++ b/rdma_lat.c
@@ -60,6 +60,7 @@
 #define PINGPONG_RDMA_WRID	3
 #define MAX_INLINE 400
 
+static int max_inline = MAX_INLINE;
 static int page_size;
 static pid_t pid;
 
@@ -603,7 +604,7 @@ static struct pingpong_context *pp_init_ctx(void *ptr, struct pp_data *data)
 			.max_recv_wr  = 1,
 			.max_send_sge = 1,
 			.max_recv_sge = 1,
-			.max_inline_data = MAX_INLINE
+			.max_inline_data = max_inline
 		},
 		.qp_type = IBV_QPT_RC
 	};
@@ -915,6 +916,7 @@ static void usage(const char *argv0)
 	printf("  -s, --size=<size>      size of message to exchange (default 1)\n");
 	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("  -m, --max-inline=<max-inline>  max size for inline data (default 400 bytes)\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");
@@ -1036,6 +1038,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 = "max-inline",     .has_arg = 1, .val = 'm' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
 			{ .name = "report-histogram",.has_arg = 0, .val = 'H' },
 			{ .name = "report-unsorted",.has_arg = 0, .val = 'U' },
@@ -1043,7 +1046,7 @@ int main(int argc, char *argv[])
 			{ 0 }
 		};
 
-		c = getopt_long(argc, argv, "p:d:i:s:n:t:CHUc", long_options, NULL);
+		c = getopt_long(argc, argv, "p:d:i:s:n:t:m:CHUc", long_options, NULL);
 		if (c == -1)
 			break;
 
@@ -1087,6 +1090,10 @@ int main(int argc, char *argv[])
 
 				break;
 
+			case 'm':
+				max_inline = strtol(optarg, NULL, 0);
+				break;
+
 			case 'C':
 				report.cycles = 1;
 				break;
@@ -1192,7 +1199,7 @@ int main(int argc, char *argv[])
 	ctx->wr.sg_list    = &ctx->list;
 	ctx->wr.num_sge    = 1;
 	ctx->wr.opcode     = IBV_WR_RDMA_WRITE;
-	if (ctx->size > MAX_INLINE || ctx->size == 0) {
+	if (ctx->size > max_inline || ctx->size == 0) {
 		ctx->wr.send_flags = IBV_SEND_SIGNALED;
 	} else {
 		ctx->wr.send_flags = IBV_SEND_SIGNALED | IBV_SEND_INLINE;



More information about the ewg mailing list