diff options
author | Dotan Barak <dotanb@dev.mellanox.co.il> | 2007-05-06 16:46:42 +0300 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-05-17 15:14:05 -0700 |
commit | 4cf4f3dbb25b77aefd8bc5050a637d7b4d1304ab (patch) | |
tree | 0d88f7f907c3ea6d9c38d172c6dcda69fc3ea2db | |
parent | 108f7f77a6485e8d6405fb255e81daa320a6ac70 (diff) | |
download | libibverbs-4cf4f3dbb25b77aefd8bc5050a637d7b4d1304ab.tar.gz |
ibv_devinfo: Decode max_vl_num to actual number
Print max_vl_num as the actual number of VLs in addition to the
encoded value.
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | examples/devinfo.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/devinfo.c b/examples/devinfo.c index 476e00e..d054999 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -135,6 +135,18 @@ static const char *speed_str(uint8_t speed) } } +static const char *vl_str(uint8_t vl_num) +{ + switch (vl_num) { + case 1: return "1"; + case 2: return "2"; + case 3: return "4"; + case 4: return "8"; + case 5: return "15"; + default: return "invalid value"; + } +} + static int print_all_port_gids(struct ibv_context *ctx, uint8_t port_num, int tbl_len) { union ibv_gid gid; @@ -266,7 +278,8 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port) if (verbose) { printf("\t\t\tmax_msg_sz:\t\t0x%x\n", port_attr.max_msg_sz); printf("\t\t\tport_cap_flags:\t\t0x%08x\n", port_attr.port_cap_flags); - printf("\t\t\tmax_vl_num:\t\t%d\n", port_attr.max_vl_num); + printf("\t\t\tmax_vl_num:\t\t%s (%d)\n", + vl_str(port_attr.max_vl_num), port_attr.max_vl_num); printf("\t\t\tbad_pkey_cntr:\t\t0x%x\n", port_attr.bad_pkey_cntr); printf("\t\t\tqkey_viol_cntr:\t\t0x%x\n", port_attr.qkey_viol_cntr); printf("\t\t\tsm_sl:\t\t\t%d\n", port_attr.sm_sl); |