]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Show transport (IB vs. iWARP) type in ibv_devinfo
authorJeff Squyres <jsquyres@cisco.com>
Wed, 28 Oct 2009 22:42:21 +0000 (15:42 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 28 Oct 2009 22:45:29 +0000 (15:45 -0700)
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
examples/devinfo.c

index caa5d5f6b430abb07d45acbb1070474edd5a4664..2f6b4887ff9a8233f9bdf547617eaaed76d3ea3e 100644 (file)
@@ -67,6 +67,15 @@ static const char *guid_str(uint64_t node_guid, char *str)
        return str;
 }
 
+static const char *transport_str(enum ibv_transport_type transport)
+{
+       switch (transport) {
+       case IBV_TRANSPORT_IB:    return "InfiniBand";
+       case IBV_TRANSPORT_IWARP: return "iWARP";
+       default:                  return "invalid transport";
+       }
+}
+
 static const char *port_state_str(enum ibv_port_state pstate)
 {
        switch (pstate) {
@@ -197,6 +206,8 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
        }
 
        printf("hca_id:\t%s\n", ibv_get_device_name(ib_dev));
+       printf("\ttransport:\t\t\t%s (%d)\n",
+              transport_str(ib_dev->transport_type), ib_dev->transport_type);
        if (strlen(device_attr.fw_ver))
                printf("\tfw_ver:\t\t\t\t%s\n", device_attr.fw_ver);
        printf("\tnode_guid:\t\t\t%s\n", guid_str(device_attr.node_guid, buf));