int rc;
if (!g_net_is_compatible (argv[0], SOCKLND, RALND, PTLLND, MXLND,
- O2IBLND, 0))
+ O2IBLND, GNILND, 0))
return -1;
for (index = 0;;index++) {
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;
+
+ if (disconn)
+ state = "D";
+ else
+ state = data.ioc_flags & 0xffff ? "C" : "U";
+
+ printf ("%-20s (%d) %s [%d] "LPU64" "
+ "sq %d/%d tx %d/%d/%d\n",
+ libcfs_nid2str(data.ioc_nid), /* peer nid */
+ data.ioc_net, /* gemini device id */
+ state, /* peer is Connecting, Up, or Down */
+ data.ioc_count, /* peer refcount */
+ data.ioc_u64[0], /* peerstamp */
+ data.ioc_u32[2], data.ioc_u32[3], /* tx and rx seq */
+ /* fmaq, nfma, nrdma */
+ data.ioc_u32[0], data.ioc_u32[1], data.ioc_u32[4]
+ );
} else {
printf ("%-20s [%d]\n",
libcfs_nid2str(data.ioc_nid), data.ioc_count);
int port = 0;
int rc;
- if (!g_net_is_compatible (argv[0], SOCKLND, RALND, 0))
+ if (!g_net_is_compatible (argv[0], SOCKLND, RALND,
+ GNILND, 0))
return -1;
if (argc != 4) {
- fprintf (stderr, "usage(tcp,ra): %s nid ipaddr port\n",
+ fprintf (stderr, "usage(tcp,ra,gni): %s nid ipaddr port\n",
argv[0]);
return 0;
}
int rc;
if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND, PTLLND,
- O2IBLND, 0))
+ O2IBLND, GNILND, 0))
return -1;
if (g_net_is_compatible(NULL, SOCKLND, 0)) {
int index;
int rc;
- if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND, O2IBLND, 0))
+ if (!g_net_is_compatible (argv[0], SOCKLND, RALND, MXLND, O2IBLND,
+ GNILND, 0))
return -1;
for (index = 0; ; index++) {
printf ("%s mtu %d\n",
libcfs_nid2str(data.ioc_nid),
data.ioc_u32[0]); /* path MTU */
+ } else if (g_net_is_compatible (NULL, GNILND, 0)) {
+ printf ("%-20s [%d]\n",
+ libcfs_nid2str(data.ioc_nid),
+ data.ioc_u32[0] /* device id */);
} else {
printf ("%s\n", libcfs_nid2str(data.ioc_nid));
}
return 0;
}
- if (!g_net_is_compatible (NULL, SOCKLND, RALND, MXLND, O2IBLND, 0))
+ if (!g_net_is_compatible (NULL, SOCKLND, RALND, MXLND, O2IBLND,
+ GNILND, 0))
return 0;
if (argc >= 2 &&
return 0;
}
- if (!g_net_is_compatible (argv[0], SOCKLND, 0))
+ if (!g_net_is_compatible (argv[0], SOCKLND, GNILND, 0))
return -1;
if (argc > 1 &&
struct libcfs_ioctl_data data;
lnet_nid_t gateway_nid;
unsigned int hops = 1;
+ unsigned int priority = 0;
char *end;
int rc;
- if (argc < 2 || argc > 3)
- {
- fprintf (stderr, "usage: %s gateway [hopcount]\n", argv[0]);
- return (0);
- }
+ if (argc < 2 || argc > 4) {
+ fprintf(stderr, "usage: %s gateway [hopcount [priority]]\n",
+ argv[0]);
+ return -1;
+ }
if (!g_net_is_set(argv[0]))
return (-1);
return (-1);
}
- if (argc == 3) {
- hops = strtoul(argv[2], &end, 0);
- if (hops >= 256 || *end != 0) {
- fprintf (stderr, "Can't parse hopcount \"%s\"\n", argv[2]);
- return -1;
- }
- }
-
- LIBCFS_IOC_INIT(data);
- data.ioc_net = g_net;
- data.ioc_count = hops;
- data.ioc_nid = gateway_nid;
+ if (argc > 2) {
+ hops = strtoul(argv[2], &end, 0);
+ if (hops == 0 || hops >= 256 || (end != NULL && *end != 0)) {
+ fprintf(stderr, "Can't parse hopcount \"%s\"\n",
+ argv[2]);
+ return -1;
+ }
+ if (argc == 4) {
+ priority = strtoul(argv[3], &end, 0);
+ if (end != NULL && *end != 0) {
+ fprintf(stderr,
+ "Can't parse priority \"%s\"\n",
+ argv[3]);
+ return -1;
+ }
+ }
+ }
+
+ LIBCFS_IOC_INIT(data);
+ data.ioc_net = g_net;
+ data.ioc_count = hops;
+ data.ioc_nid = gateway_nid;
+ data.ioc_priority = priority;
rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_ADD_ROUTE, &data);
if (rc != 0) {
lnet_nid_t nid;
unsigned int hops;
int alive;
+ unsigned int pri;
for (index = 0;;index++)
{
hops = data.ioc_count;
nid = data.ioc_nid;
alive = data.ioc_flags;
+ pri = data.ioc_priority;
- printf ("net %18s hops %u gw %32s %s\n",
- libcfs_net2str(net), hops,
- libcfs_nid2str(nid), alive ? "up" : "down");
+ printf("net %18s hops %u gw %32s %s pri %u\n",
+ libcfs_net2str(net), hops,
+ libcfs_nid2str(nid), alive ? "up" : "down", pri);
}
if (errno != ENOENT)