[openib-general] [PATCH] libibverbs: report board id in ibv_devinfo
Michael S. Tsirkin
mst at mellanox.co.il
Mon Dec 12 08:09:20 PST 2005
Report board_id from ibv_devinfo, if present.
Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: openib/src/userspace/libibverbs/examples/devinfo.c
===================================================================
--- openib/src/userspace/libibverbs/examples/devinfo.c (revision 4399)
+++ openib/src/userspace/libibverbs/examples/devinfo.c (working copy)
@@ -174,6 +174,7 @@ static int print_hca_cap(struct ibv_devi
struct ibv_context *ctx;
struct ibv_device_attr device_attr;
struct ibv_port_attr port_attr;
+ struct sysfs_attribute *attr;
int rc = 0;
uint8_t port;
char buf[256];
@@ -198,6 +199,12 @@ static int print_hca_cap(struct ibv_devi
printf("\tvendor_id:\t\t\t0x%04x\n", device_attr.vendor_id);
printf("\tvendor_part_id:\t\t\t%d\n", device_attr.vendor_part_id);
printf("\thw_ver:\t\t\t\t0x%X\n", device_attr.hw_ver);
+ attr = sysfs_get_classdev_attr(ib_dev->ibdev, "board_id");
+ if (attr) {
+ printf("\tboard_id:\t\t\t%s", attr->value);
+ sysfs_close_attribute(attr);
+ }
+
printf("\tphys_port_cnt:\t\t\t%d\n", device_attr.phys_port_cnt);
if (verbose) {
--
MST
More information about the general
mailing list