mirror of https://gitee.com/openkylin/linux.git
b40f4757da
In practice, each RDMA device has a unique set of counters that the hardware implements. Having a central set of counters that they must all adhere to is limiting and causes many useful counters to not be available. Therefore we create a dynamic counter registration infrastructure. The driver must implement a stats structure allocation routine, in which the driver must place the directory name it wants, a list of names for all of the counters, an array of u64 counters themselves, plus a few generic configuration options. We then implement a core routine to create a sysfs file for each of the named stats elements, and a core routine to retrieve the stats when any of the sysfs attribute files are read. To avoid excessive beating on the stats generation routine in the drivers, the core code also caches the stats for a short period of time so that someone attempting to read all of the stats in a given device's directory will not result in a stats generation call per file read. Future work will attempt to standardize just the shared stats elements, and possibly add a method to get the stats via netlink in addition to sysfs. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com> [ Add caching, make structure names more informative, add i40iw support, other significant rewrites from the original patch ] |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
i40iw.h | ||
i40iw_cm.c | ||
i40iw_cm.h | ||
i40iw_ctrl.c | ||
i40iw_d.h | ||
i40iw_hmc.c | ||
i40iw_hmc.h | ||
i40iw_hw.c | ||
i40iw_main.c | ||
i40iw_osdep.h | ||
i40iw_p.h | ||
i40iw_pble.c | ||
i40iw_pble.h | ||
i40iw_puda.c | ||
i40iw_puda.h | ||
i40iw_register.h | ||
i40iw_status.h | ||
i40iw_type.h | ||
i40iw_ucontext.h | ||
i40iw_uk.c | ||
i40iw_user.h | ||
i40iw_utils.c | ||
i40iw_verbs.c | ||
i40iw_verbs.h | ||
i40iw_vf.c | ||
i40iw_vf.h | ||
i40iw_virtchnl.c | ||
i40iw_virtchnl.h |