]> asedeno.scripts.mit.edu Git - linux.git/commit
RDMA/nldev: add driver-specific resource tracking
authorSteve Wise <swise@opengridcomputing.com>
Thu, 3 May 2018 15:41:30 +0000 (08:41 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 3 May 2018 19:51:27 +0000 (15:51 -0400)
commitda5c8507821573b8ed6e3f47e009f273493ffaf7
tree4666b0a2242ebb9deda02fcd6b7eaeacb3b44048
parent25a0ad85156a7b697d4340560fff0d25a3b19243
RDMA/nldev: add driver-specific resource tracking

Each driver can register a "fill entry" function with the restrack core.
This function will be called when filling out a resource, allowing the
driver to add driver-specific details.  The details consist of a
nltable of nested attributes, that are in the form of <key, [print-type],
value> tuples.  Both key and value attributes are mandatory.  The key
nlattr must be a string, and the value nlattr can be one of the driver
attributes that are generic, but typed, allowing the attributes to be
validated.  Currently the driver nlattr types include string, s32,
u32, s64, and u64.  The print-type nlattr allows a driver to specify
an alternative display format for user tools displaying the attribute.
For example, a u32 attribute will default to "%u", but a print-type
attribute can be included for it to be displayed in hex.  This allows
the user tool to print the number in the format desired by the driver
driver.

More attrs can be defined as they become needed by drivers.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/nldev.c
drivers/infiniband/core/restrack.c
include/rdma/restrack.h
include/uapi/rdma/rdma_netlink.h