<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>[PATCH] Osmtest - update command options + vapi fix </TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi , Hal .</FONT>
<BR><FONT SIZE=2>We've decided to keep and maintain Osmtest in the main trunk , since it is not only a test but a tool to validate SA/SM.</FONT></P>
<P><FONT SIZE=2>The following is a small patch for the follwoing :</FONT>
<BR><FONT SIZE=2>1. Support old form of running osmtest , i.e instead of -g=<port guid> , use -g <port guid> and add '-p' option to display current available port guids.</FONT></P>
<P><FONT SIZE=2>2. Support Vapi stack.</FONT>
<BR><FONT SIZE=2>3. Update Service flow (Update one of the service lease checks from 1 sec to 4 sec).</FONT>
<BR><FONT SIZE=2>4. Ident switch-case) issues in main.c </FONT>
</P>
<P><FONT SIZE=2>Thanks , Liran .</FONT>
</P>
<BR>
<P><FONT SIZE=2>Signed-off-by: Liran Sorani <liran@mellanox.co.il></FONT>
</P>
<P><FONT SIZE=2>Index: osmt_mtl_regular_qp.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- osmt_mtl_regular_qp.c (revision 3928)</FONT>
<BR><FONT SIZE=2>+++ osmt_mtl_regular_qp.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -73,7 +73,7 @@</FONT>
<BR><FONT SIZE=2> #include <vapi_common.h></FONT>
<BR><FONT SIZE=2> #include <ib_defs.h></FONT>
<BR><FONT SIZE=2> #include <osmt_mtl_regular_qp.h></FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+#include <complib/cl_types.h></FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2> * Initialize the QP etc.</FONT>
<BR><FONT SIZE=2> * Given in res: port_num, max_outs_sq, max_outs_rq</FONT>
<BR><FONT SIZE=2>Index: osmt_service.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- osmt_service.c (revision 3928)</FONT>
<BR><FONT SIZE=2>+++ osmt_service.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -1266,7 +1266,7 @@</FONT>
<BR><FONT SIZE=2> p_osmt,</FONT>
<BR><FONT SIZE=2> cl_ntoh64(id[1]), /* IN ib_net64_t service_id, */</FONT>
<BR><FONT SIZE=2> IB_DEFAULT_PKEY,/* IN ib_net16_t service_pkey, */</FONT>
<BR><FONT SIZE=2>- cl_hton32(0x00000001), /* IN ib_net32_t service_lease, */</FONT>
<BR><FONT SIZE=2>+ cl_hton32(0x00000004), /* IN ib_net32_t service_lease, */</FONT>
<BR><FONT SIZE=2> 11, /* IN uint8_t service_key_lsb, */</FONT>
<BR><FONT SIZE=2> (char*)service_name[1] /* IN char *service_name */</FONT>
<BR><FONT SIZE=2> );</FONT>
<BR><FONT SIZE=2>Index: main.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- main.c (revision 3928)</FONT>
<BR><FONT SIZE=2>+++ main.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -128,9 +128,11 @@</FONT>
<BR><FONT SIZE=2> "--guid <GUID in hex>\n"</FONT>
<BR><FONT SIZE=2> " This option specifies the local port GUID value\n"</FONT>
<BR><FONT SIZE=2> " with which osmtest should bind. osmtest may be\n"</FONT>
<BR><FONT SIZE=2>- " bound to 1 port at a time.\n"</FONT>
<BR><FONT SIZE=2>- " Without -g, osmtest displays a menu of possible\n"</FONT>
<BR><FONT SIZE=2>- " port GUIDs and waits for user input.\n\n" );</FONT>
<BR><FONT SIZE=2>+ " bound to 1 port at a time.\n\n");</FONT>
<BR><FONT SIZE=2>+ printf( "-p \n"</FONT>
<BR><FONT SIZE=2>+ "--port\n"</FONT>
<BR><FONT SIZE=2>+ " This option display menu of possible local port GUID values\n"</FONT>
<BR><FONT SIZE=2>+ " with which osmtest could bind.\n\n");</FONT>
<BR><FONT SIZE=2> printf( "-h\n"</FONT>
<BR><FONT SIZE=2> "--help\n" " Display this usage info then exit.\n\n" );</FONT>
<BR><FONT SIZE=2> printf( "-i <filename>\n"</FONT>
<BR><FONT SIZE=2>@@ -160,9 +162,9 @@</FONT>
<BR><FONT SIZE=2> " --- -----------------\n"</FONT>
<BR><FONT SIZE=2> " -M1 - Short Multicast Flow (default) - single mode.\n"</FONT>
<BR><FONT SIZE=2> " -M2 - Short Multicast Flow - multiple mode.\n"</FONT>
<BR><FONT SIZE=2>- " -M3 - Long Multicast Flow - single mode.\n"</FONT>
<BR><FONT SIZE=2>- " -M4 - Long Multicast Flow - mutiple mode.\n"</FONT>
<BR><FONT SIZE=2>- " Single mode - Osmtest is tested alone, with no other\n"</FONT>
<BR><FONT SIZE=2>+ " -M3 - Long MultiCast Flow - single mode.\n"</FONT>
<BR><FONT SIZE=2>+ " -M4 - Long MultiCast Flow - mutiple mode.\n"</FONT>
<BR><FONT SIZE=2>+ " Single mode - Osmtest is tested alone , with no other \n"</FONT>
<BR><FONT SIZE=2> " apps that interact vs. OpenSM MC.\n"</FONT>
<BR><FONT SIZE=2> " Multiple mode - Could be run with other apps using MC vs.\n"</FONT>
<BR><FONT SIZE=2> " OpenSM."</FONT>
<BR><FONT SIZE=2>@@ -305,7 +307,7 @@</FONT>
<BR><FONT SIZE=2> char flow_name[64];</FONT>
<BR><FONT SIZE=2> boolean_t mem_track = FALSE;</FONT>
<BR><FONT SIZE=2> uint32_t next_option;</FONT>
<BR><FONT SIZE=2>- const char *const short_option = "f:l:m:M:d:g::s:t:i:cvVh";</FONT>
<BR><FONT SIZE=2>+ const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvVh";</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2> * In the array below, the 2nd parameter specified the number</FONT>
<BR><FONT SIZE=2>@@ -322,9 +324,10 @@</FONT>
<BR><FONT SIZE=2> {"inventory", 1, NULL, 'i'},</FONT>
<BR><FONT SIZE=2> {"max_lid", 1, NULL, 'm'},</FONT>
<BR><FONT SIZE=2> {"guid", 2, NULL, 'g'},</FONT>
<BR><FONT SIZE=2>+ {"port", 0, NULL, 'p'},</FONT>
<BR><FONT SIZE=2> {"help", 0, NULL, 'h'},</FONT>
<BR><FONT SIZE=2> {"stress", 1, NULL, 's'},</FONT>
<BR><FONT SIZE=2>- {"Multicast_Mode", 1, NULL, 'M'},</FONT>
<BR><FONT SIZE=2>+ {"MultiCast_Mode", 1, NULL, 'M'},</FONT>
<BR><FONT SIZE=2> {"timeout", 1, NULL, 't'},</FONT>
<BR><FONT SIZE=2> {"verbose", 0, NULL, 'v'},</FONT>
<BR><FONT SIZE=2> {"log_file", 1, NULL, 'l'},</FONT>
<BR><FONT SIZE=2>@@ -363,7 +366,6 @@</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> next_option = getopt_long_only( argc, argv, short_option,</FONT>
<BR><FONT SIZE=2> long_option, NULL );</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2> switch ( next_option )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> case 'c':</FONT>
<BR><FONT SIZE=2>@@ -446,28 +448,30 @@</FONT>
<BR><FONT SIZE=2> break;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> case 'g':</FONT>
<BR><FONT SIZE=2>- /*</FONT>
<BR><FONT SIZE=2>- Specifies port guid with which to bind.</FONT>
<BR><FONT SIZE=2>- */</FONT>
<BR><FONT SIZE=2>- if (optarg) {</FONT>
<BR><FONT SIZE=2>- guid = cl_hton64( strtoull( optarg, NULL, 16 ));</FONT>
<BR><FONT SIZE=2>- printf(" Guid <0x%"PRIx64">\n", cl_hton64( guid ));</FONT>
<BR><FONT SIZE=2>- } else</FONT>
<BR><FONT SIZE=2>- guid = INVALID_GUID;</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ * Specifies port guid with which to bind.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ guid = cl_hton64( strtoull( optarg, NULL, 16 ));</FONT>
<BR><FONT SIZE=2>+ printf(" Guid <0x%"PRIx64">\n", cl_hton64( guid ));</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ case 'p':</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ * Display current port guids</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ guid = INVALID_GUID;</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2> case 't':</FONT>
<BR><FONT SIZE=2>- /*</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2> * Specifies transaction timeout.</FONT>
<BR><FONT SIZE=2>- */</FONT>
<BR><FONT SIZE=2>- opt.transaction_timeout = strtol( optarg, NULL, 0 );</FONT>
<BR><FONT SIZE=2>- printf( "\tTransaction timeout = %d\n", opt.transaction_timeout );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ opt.transaction_timeout = strtol( optarg, NULL, 0 );</FONT>
<BR><FONT SIZE=2>+ printf( "\tTransaction timeout = %d\n", opt.transaction_timeout );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> case 'l':</FONT>
<BR><FONT SIZE=2>- opt.log_file = optarg;</FONT>
<BR><FONT SIZE=2>- printf("\tLog <A HREF="File:%s\n" TARGET="_blank">File:%s\n</A>", opt.log_file );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>+ opt.log_file = optarg;</FONT>
<BR><FONT SIZE=2>+ printf("\tLog <A HREF="File:%s\n" TARGET="_blank">File:%s\n</A>", opt.log_file );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> case 'v':</FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2>@@ -510,32 +514,32 @@</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> break;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- case 'M':</FONT>
<BR><FONT SIZE=2>- /*</FONT>
<BR><FONT SIZE=2>- * Perform stress test.</FONT>
<BR><FONT SIZE=2>- */</FONT>
<BR><FONT SIZE=2>- opt.mmode = strtol( optarg, NULL, 0 );</FONT>
<BR><FONT SIZE=2>- printf( "\tMulticast test enabled: " );</FONT>
<BR><FONT SIZE=2>- switch ( opt.mmode )</FONT>
<BR><FONT SIZE=2>- {</FONT>
<BR><FONT SIZE=2>- case 1:</FONT>
<BR><FONT SIZE=2>- printf( "Short MC Flow - single mode (default)\n" );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>- case 2:</FONT>
<BR><FONT SIZE=2>- printf( "Short MC Flow - mutiple mode\n" );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>- case 3:</FONT>
<BR><FONT SIZE=2>- printf( "Long MC Flow - single mode\n" );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>- case 4:</FONT>
<BR><FONT SIZE=2>- printf( "Long MC Flow - mutiple mode\n" );</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>- default:</FONT>
<BR><FONT SIZE=2>- printf( "Unknown value %u (ignored)\n", opt.stress );</FONT>
<BR><FONT SIZE=2>- opt.mmode = 0;</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>- }</FONT>
<BR><FONT SIZE=2>- break;</FONT>
<BR><FONT SIZE=2>+ case 'M':</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ * Perform stress test.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ opt.mmode = strtol( optarg, NULL, 0 );</FONT>
<BR><FONT SIZE=2>+ printf( "\tMultiCast test enabled: " );</FONT>
<BR><FONT SIZE=2>+ switch ( opt.mmode )</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ case 1:</FONT>
<BR><FONT SIZE=2>+ printf( "Short MC Flow - single mode (default)\n" );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ case 2:</FONT>
<BR><FONT SIZE=2>+ printf( "Short MC Flow - mutiple mode\n" );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ case 3:</FONT>
<BR><FONT SIZE=2>+ printf( "Long MC Flow - single mode\n" );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ case 4:</FONT>
<BR><FONT SIZE=2>+ printf( "Long MC Flow - mutiple mode\n" );</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ default:</FONT>
<BR><FONT SIZE=2>+ printf( "Unknown value %u (ignored)\n", opt.stress );</FONT>
<BR><FONT SIZE=2>+ opt.mmode = 0;</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ break;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> case 'd':</FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2>Index: Makefile.am</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- Makefile.am (revision 3928)</FONT>
<BR><FONT SIZE=2>+++ Makefile.am (working copy)</FONT>
<BR><FONT SIZE=2>@@ -13,9 +13,11 @@</FONT>
<BR><FONT SIZE=2> bin_PROGRAMS = osmtest </FONT>
<BR><FONT SIZE=2> osmtest_SOURCES = main.c osmtest.c osmt_service.c osmt_slvl_vl_arb.c \</FONT>
<BR><FONT SIZE=2> osmt_multicast.c osmt_inform.c</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+if OSMV_VAPI</FONT>
<BR><FONT SIZE=2>+osmtest_SOURCES = osmt_mtl_regular_qp.c</FONT>
<BR><FONT SIZE=2>+endif</FONT>
<BR><FONT SIZE=2> osmtest_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)</FONT>
<BR><FONT SIZE=2>-osmtest_LDADD = -L../complib -L../libvendor -L../opensm -L$(libdir) \</FONT>
<BR><FONT SIZE=2>+osmtest_LDADD = -L../complib -L../libvendor -L../opensm -L$(libdir) -L. \</FONT>
<BR><FONT SIZE=2> $(OSMV_LDADD) -lopensm -losmcomp -losmvendor</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> osmtest_LDFLAGS = -Wl,--rpath -Wl,$(libdir) -lpthread -L../opensm</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>> Liran Sorani</FONT>
<BR><FONT SIZE=2>> Mellanox Technologies LTD.</FONT>
<BR><FONT SIZE=2>> <A HREF="mailto:liran@mellanox.co.il">mailto:liran@mellanox.co.il</A></FONT>
<BR><FONT SIZE=2>> Phone: +972(4)9097200 Ext: 214</FONT>
<BR><FONT SIZE=2>> Israel, Yokneam P.O.B 586 ZIP 20692</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
</BODY>
</HTML>