[openib-general] Re:[PATCH] Osmtest - update command option + vapi fix

Liran Sorani liran at mtl075.yok.mtl.com
Tue Nov 1 05:38:51 PST 2005


Hi Hal,
1. Regarding the osmtest_SOURCES , it works both ways (i.e compile all files required) , 
still the correct one is +=
2. Following is the patch for main.c :

Index: main.c
===================================================================
--- main.c	(revision 3928)
+++ main.c	(working copy)
@@ -128,9 +128,11 @@
 			"--guid <GUID in hex>\n"
 			"          This option specifies the local port GUID value\n"
 			"          with which osmtest should bind.  osmtest may be\n"
-			"          bound to 1 port at a time.\n"
-			"          Without -g, osmtest displays a menu of possible\n"
-			"          port GUIDs and waits for user input.\n\n" );
+			"          bound to 1 port at a time.\n\n");
+        printf( "-p \n"
+                        "--port\n"
+                        "          This option display menu of possible local port GUID values\n"
+                        "          with which osmtest could bind.\n\n");
 	printf( "-h\n"
 			"--help\n" "          Display this usage info then exit.\n\n" );
 	printf( "-i <filename>\n"
@@ -160,9 +162,9 @@
             "          ---    -----------------\n"
             "          -M1  - Short Multicast Flow (default) - single mode.\n"
             "          -M2  - Short Multicast Flow  - multiple mode.\n"
-            "          -M3  - Long Multicast Flow - single mode.\n"
-            "          -M4  - Long Multicast Flow - mutiple mode.\n"
-            " Single mode - Osmtest is tested alone, with no other\n"
+            "          -M3  - Long MultiCast Flow - single mode.\n"
+            "          -M4  - Long MultiCast Flow - mutiple mode.\n"
+            " Single mode - Osmtest is tested alone , with no other  \n"
             "   apps that interact vs. OpenSM MC.\n"
             " Multiple mode - Could be run with other apps using MC vs.\n"
             "   OpenSM."
@@ -305,7 +307,7 @@
     char flow_name[64];
    boolean_t mem_track = FALSE;
 	uint32_t next_option;
-	const char *const short_option = "f:l:m:M:d:g::s:t:i:cvVh";
+	const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvVh";
 
 	/*
 	 * In the array below, the 2nd parameter specified the number
@@ -322,9 +324,10 @@
 		{"inventory", 1, NULL, 'i'},
 		{"max_lid",   1, NULL, 'm'},
 		{"guid",      2, NULL, 'g'},
+		{"port",      0, NULL, 'p'},
 		{"help",      0, NULL, 'h'},
 		{"stress",    1, NULL, 's'},
-        {"Multicast_Mode",    1, NULL, 'M'},
+        {"MultiCast_Mode",    1, NULL, 'M'},
 		{"timeout",   1, NULL, 't'},
 		{"verbose",   0, NULL, 'v'},
 		{"log_file",  1, NULL, 'l'},
@@ -363,7 +366,6 @@
 	{
 		next_option = getopt_long_only( argc, argv, short_option,
 										long_option, NULL );
-
 		switch ( next_option )
 		{
 		case 'c':
@@ -446,28 +448,30 @@
 			break;
 
 		case 'g':
-		/*
-            Specifies port guid with which to bind.
-            */
-            if (optarg) {
-                guid = cl_hton64( strtoull( optarg, NULL, 16 ));
-                printf(" Guid <0x%"PRIx64">\n", cl_hton64( guid ));
-            } else
-                guid = INVALID_GUID;
-            break;
-
+			/*
+	                * Specifies port guid with which to bind.
+	                */
+       		        guid = cl_hton64( strtoull( optarg, NULL, 16 ));
+                	printf(" Guid <0x%"PRIx64">\n", cl_hton64( guid ));
+	                break;
+		case 'p':
+			/*
+			* Display current port guids
+			*/
+                	guid = INVALID_GUID;
+	            	break;
 		case 't':
-			/*
+               		/*
 			 * Specifies transaction timeout.
-			 */
-		  opt.transaction_timeout = strtol( optarg, NULL, 0 );
-		  printf( "\tTransaction timeout = %d\n", opt.transaction_timeout );
-		  break;
+			*/
+		  	opt.transaction_timeout = strtol( optarg, NULL, 0 );
+	  		printf( "\tTransaction timeout = %d\n", opt.transaction_timeout );
+			break;
 
 		case 'l':
-		  opt.log_file = optarg;
-		  printf("\tLog File:%s\n", opt.log_file );
-		  break;
+			opt.log_file = optarg;
+			printf("\tLog File:%s\n", opt.log_file );
+			break;
 
 		case 'v':
 			/*
@@ -510,32 +514,32 @@
 			}
 			break;
 
-        case 'M':
-            /*
-             * Perform stress test.
-             */
-            opt.mmode = strtol( optarg, NULL, 0 );
-            printf( "\tMulticast test enabled: " );
-            switch ( opt.mmode )
-            {
-            case 1:
-                printf( "Short MC Flow - single mode (default)\n" );
-                break;
-            case 2:
-                printf( "Short MC Flow - mutiple mode\n" );
-                break;
-            case 3:
-                printf( "Long MC Flow - single mode\n" );
-                break;
-            case 4:
-                printf( "Long MC Flow - mutiple mode\n" );
-                break;
-            default:
-                printf( "Unknown value %u (ignored)\n", opt.stress );
-                opt.mmode = 0;
-                break;
-            }
-            break;
+	        case 'M':
+            		/*
+		         * Perform stress test.
+		        */
+            		opt.mmode = strtol( optarg, NULL, 0 );
+            		printf( "\tMultiCast test enabled: " );
+		        switch ( opt.mmode )
+		        {
+		        case 1:
+                		printf( "Short MC Flow - single mode (default)\n" );
+		                break;
+		        case 2:
+                		printf( "Short MC Flow - mutiple mode\n" );
+		                break;
+		        case 3:
+                		printf( "Long MC Flow - single mode\n" );
+		                break;
+		        case 4:
+		                printf( "Long MC Flow - mutiple mode\n" );
+		                break;
+		        default:
+                		printf( "Unknown value %u (ignored)\n", opt.stress );
+		                opt.mmode = 0;
+                		break;
+            		}
+		        break;
 
 		case 'd':
 			/*




More information about the general mailing list