From: Jeff Squyres Date: Wed, 28 Oct 2009 22:42:21 +0000 (-0700) Subject: Show transport (IB vs. iWARP) type in ibv_devinfo X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=7c9252729a711fb8f21b6d76f816f8a1d5ec1169;p=~shefty%2Flibibverbs.git Show transport (IB vs. iWARP) type in ibv_devinfo Signed-off-by: Jeff Squyres Signed-off-by: Roland Dreier --- diff --git a/examples/devinfo.c b/examples/devinfo.c index caa5d5f..2f6b488 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -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));