Whamcloud - gitweb
LU-6068 misc: update old URLs to hpdd.intel.com
[fs/lustre-release.git] / lnet / utils / portals.c
index fc6cb51..bd670ce 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  *
- *   This file is part of Portals, http://www.sf.net/projects/lustre/
+ * Copyright (c) 2013, 2014, Intel Corporation.
+ *
+ *   This file is part of Lustre, https://wiki.hpdd.intel.com/
  *
  *   Portals is free software; you can redistribute it and/or
  *   modify it under the terms of version 2 of the GNU General Public
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-
-#include <libcfs/libcfsutil.h>
-#include <lnet/nidstr.h>
-#include <lnet/lnetctl.h>
-#include <lnet/socklnd.h>
-#include <lnet/lib-dlc.h>
+#include <errno.h>
 #include <getopt.h>
+#include <limits.h>
 #include <netdb.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <time.h>
+#include <linux/types.h>
+#include <libcfs/libcfs.h>
+#include <libcfs/util/string.h>
+#include <libcfs/util/ioctl.h>
+#include <lnet/lnetctl.h>
+#include <lnet/socklnd.h>
+#include <lnet/lnet.h>
 
 unsigned int libcfs_debug;
 unsigned int libcfs_printk = D_CANTMASK;
@@ -572,8 +584,7 @@ jt_ptl_print_peers (int argc, char **argv)
         int                      index;
         int                      rc;
 
-       if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND,
-                                 O2IBLND, GNILND, 0))
+       if (!g_net_is_compatible (argv[0], SOCKLND, O2IBLND, GNILND, 0))
                 return -1;
 
         for (index = 0;;index++) {
@@ -589,7 +600,7 @@ jt_ptl_print_peers (int argc, char **argv)
                         id.nid = data.ioc_nid;
                         id.pid = data.ioc_u32[4];
                         printf ("%-20s [%d]%s->%s:%d #%d\n",
-                                libcfs_id2str(id), 
+                               libcfs_id2str(id),
                                 data.ioc_count, /* persistence */
                                /* my ip */
                                ptl_ipaddr_2_str(data.ioc_u32[2], buffer[0],
@@ -599,14 +610,6 @@ jt_ptl_print_peers (int argc, char **argv)
                                                 sizeof(buffer[1]), 1),
                                 data.ioc_u32[1], /* peer port */
                                 data.ioc_u32[3]); /* conn_count */
-                } else if (g_net_is_compatible(NULL, RALND, 0)) {
-                        printf ("%-20s [%d]@%s:%d\n",
-                                libcfs_nid2str(data.ioc_nid), /* peer nid */
-                                data.ioc_count,   /* peer persistence */
-                               /* peer ip */
-                               ptl_ipaddr_2_str(data.ioc_u32[0], buffer[1],
-                                                sizeof(buffer[1]), 1),
-                                data.ioc_u32[1]); /* peer port */
                } else if (g_net_is_compatible(NULL, GNILND, 0)) {
                        int disconn = data.ioc_flags >> 16;
                        char *state;
@@ -654,8 +657,7 @@ jt_ptl_add_peer (int argc, char **argv)
         int                      port = 0;
         int                      rc;
 
-       if (!g_net_is_compatible (argv[0], SOCKLND, RALND,
-                                 GNILND, 0))
+       if (!g_net_is_compatible(argv[0], SOCKLND, GNILND, 0))
                 return -1;
 
         if (argc != 4) {
@@ -705,8 +707,7 @@ jt_ptl_del_peer (int argc, char **argv)
         __u32                    ip = 0;
         int                      rc;
 
-       if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND,
-                                 O2IBLND, GNILND, 0))
+       if (!g_net_is_compatible(argv[0], SOCKLND, O2IBLND, GNILND, 0))
                 return -1;
 
         if (g_net_is_compatible(NULL, SOCKLND, 0)) {
@@ -760,8 +761,7 @@ jt_ptl_print_connections (int argc, char **argv)
         int                      index;
         int                      rc;
 
-       if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND, O2IBLND,
-                                 GNILND, 0))
+       if (!g_net_is_compatible(argv[0], SOCKLND, O2IBLND, GNILND, 0))
                 return -1;
 
         for (index = 0; ; index++) {
@@ -793,10 +793,6 @@ jt_ptl_print_connections (int argc, char **argv)
                                 data.ioc_count, /* tx buffer size */
                                 data.ioc_u32[5], /* rx buffer size */
                                 data.ioc_flags ? "nagle" : "nonagle");
-                } else if (g_net_is_compatible (NULL, RALND, 0)) {
-                        printf ("%-20s [%d]\n",
-                                libcfs_nid2str(data.ioc_nid),
-                                data.ioc_u32[0] /* device id */);
                 } else if (g_net_is_compatible (NULL, O2IBLND, 0)) {
                         printf ("%s mtu %d\n",
                                 libcfs_nid2str(data.ioc_nid),
@@ -834,8 +830,7 @@ int jt_ptl_disconnect(int argc, char **argv)
                 return 0;
         }
 
-       if (!g_net_is_compatible (NULL, SOCKLND, RALND, MXLND, O2IBLND,
-                                 GNILND, 0))
+       if (!g_net_is_compatible(NULL, SOCKLND, O2IBLND, GNILND, 0))
                 return 0;
 
         if (argc >= 2 &&
@@ -900,49 +895,6 @@ int jt_ptl_push_connection (int argc, char **argv)
         return 0;
 }
 
-int
-jt_ptl_print_active_txs (int argc, char **argv)
-{
-        struct libcfs_ioctl_data data;
-        int                      index;
-        int                      rc;
-
-        if (!g_net_is_compatible (argv[0], QSWLND, 0))
-                return -1;
-
-        for (index = 0;;index++) {
-                LIBCFS_IOC_INIT(data);
-                data.ioc_net   = g_net;
-                data.ioc_count = index;
-
-                rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_GET_TXDESC, &data);
-                if (rc != 0)
-                        break;
-
-                printf ("type %u payload %6d to %s via %s by pid %6d: "
-                        "%s, %s, state %d\n",
-                        data.ioc_u32[0],
-                        data.ioc_count,
-                        libcfs_nid2str(data.ioc_nid),
-                        libcfs_nid2str(data.ioc_u64[0]),
-                        data.ioc_u32[1],
-                        (data.ioc_flags & 1) ? "delayed" : "immediate",
-                        (data.ioc_flags & 2) ? "nblk"    : "normal",
-                        data.ioc_flags >> 2);
-        }
-
-        if (index == 0) {
-                if (errno == ENOENT) {
-                        printf ("<no active descs>\n");
-                } else {
-                        fprintf(stderr, "Error getting active transmits list: "
-                                "%s: check dmesg.\n",
-                                strerror(errno));
-                }
-        }
-        return 0;
-}
-
 int jt_ptl_ping(int argc, char **argv)
 {
         int                      rc;