Whamcloud - gitweb
* First cut working vibnal
[fs/lustre-release.git] / lnet / utils / portals.c
index 09fdf5f..d874486 100644 (file)
@@ -694,7 +694,7 @@ jt_ptl_print_peers (int argc, char **argv)
                                 ptl_ipaddr_2_str (pcfg.pcfg_size, buffer[0], 1),
                                 ptl_ipaddr_2_str (pcfg.pcfg_id, buffer[1], 1),
                                 pcfg.pcfg_misc, pcfg.pcfg_count);
-                else if (g_nal_is_compatible(NULL, RANAL, OPENIBNAL, 0))
+                else if (g_nal_is_compatible(NULL, RANAL, OPENIBNAL, VIBNAL, 0))
                         printf (LPX64"[%d]@%s:%d\n",
                                 pcfg.pcfg_nid, pcfg.pcfg_wait,
                                 ptl_ipaddr_2_str (pcfg.pcfg_id, buffer[1], 1),
@@ -728,8 +728,14 @@ jt_ptl_add_peer (int argc, char **argv)
                                  argv[0]);
                         return 0;
                 }
+        } else if (g_nal_is_compatible(NULL, VIBNAL, 0)) {
+                if (argc != 3) {
+                        fprintf (stderr, "usage(vib): %s nid ipaddr\n", 
+                                 argv[0]);
+                        return 0;
+                }
         } else if (argc != 2) {
-                fprintf (stderr, "usage(iib,vib): %s nid\n", argv[0]);
+                fprintf (stderr, "usage(iib): %s nid\n", argv[0]);
                 return 0;
         }
 
@@ -739,16 +745,16 @@ jt_ptl_add_peer (int argc, char **argv)
                 return -1;
         }
 
-        if (g_nal_is_compatible (NULL, SOCKNAL, OPENIBNAL, RANAL, 0)) {
-                if (ptl_parse_ipaddr (&ip, argv[2]) != 0) {
-                        fprintf (stderr, "Can't parse ip addr: %s\n", argv[2]);
-                        return -1;
-                }
+        if (g_nal_is_compatible (NULL, SOCKNAL, OPENIBNAL, VIBNAL, RANAL, 0) &&
+            ptl_parse_ipaddr (&ip, argv[2]) != 0) {
+                fprintf (stderr, "Can't parse ip addr: %s\n", argv[2]);
+                return -1;
+        }
 
-                if (ptl_parse_port (&port, argv[3]) != 0) {
-                        fprintf (stderr, "Can't parse port: %s\n", argv[3]);
-                        return -1;
-                }
+        if (g_nal_is_compatible (NULL, SOCKNAL, OPENIBNAL, RANAL, 0) &&
+            ptl_parse_port (&port, argv[3]) != 0) {
+                fprintf (stderr, "Can't parse port: %s\n", argv[3]);
+                return -1;
         }
 
         PCFG_INIT(pcfg, NAL_CMD_ADD_PEER);