mirror_iproute2/rdma
Steve Wise 331152752a rdma: print driver resource attributes
This enhancement allows printing rdma device-specific state, if provided
by the kernel. This is done in a generic manner, so rdma tool doesn't
need to know about the details of every type of rdma device.

Driver attributes for a rdma resource are in the form of <key,
[print_type], value> tuples, where the key is a string and the value can
be any supported driver attribute. The print_type attribute, if present,
provides a print format to use vs the standard print format for the type.
For example, the default print type for a PROVIDER_S32 value is "%d ",
but "0x%x " if the print_type of PRINT_TYPE_HEX is included inthe tuple.

Driver resources are only printed when the -dd flag is present.
If -p is present, then the output is formatted to not exceed 80 columns,
otherwise it is printed as a single row to be grep/awk friendly.

Example output:

# rdma resource show qp lqpn 1028 -dd -p
link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma]
    sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0
    size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00
    rqt_size 256 in_use 128 size 130

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-05-18 09:17:16 -07:00
..
include/uapi/rdma rdma: update rdma_netlink.h to get new driver attributes 2018-05-18 09:16:22 -07:00
.gitignore rdma: Add basic infrastructure for RDMA tool 2017-08-21 17:07:44 -07:00
dev.c rdma: Update device capabilities flags 2018-03-08 09:15:28 -08:00
link.c rdma: Print net device name and index for RDMA device 2018-04-06 09:02:32 -07:00
Makefile rdma: Move RDMA UAPI header file to be under RDMA responsibility 2018-03-26 07:02:19 -07:00
rdma.c rdma: print driver resource attributes 2018-05-18 09:17:16 -07:00
rdma.h rdma: print driver resource attributes 2018-05-18 09:17:16 -07:00
res.c rdma: print driver resource attributes 2018-05-18 09:17:16 -07:00
utils.c rdma: print driver resource attributes 2018-05-18 09:17:16 -07:00