Skip to content

RFC devlink: Add port stats

Michael Guralnik netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2devlink: Introduce stats to the port objectinclude/net/devlink.h net/core/devlink.c+108 -00 replies
2/2devlink: Add statistics to port getinclude/uapi/linux/devlink.h net/core/devlink.c+43 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH net-next 0/2] devlink: Add port stats

This patch set adds port statistics to the devlink port object. It allows device drivers to dynamically attach and detach counters from a devlink port object.

The approach of adding object-attached statistics is already supported for trap with traffic statistics and for the dev object with reload statistics. For the port object, this will allow the device driver to expose and dynamicly control a set of metrics related to the port.
Currently we add support only for counters, but later API extensions can be made to support histograms or configurable counters.

The statistics are exposed to the user with the port get command.

Example:

# devlink -s port show
pci/0000:00:0b.0/65535: type eth netdev eth1 flavour physical port 0 splittable false
  stats:
    counter1 235
    counter2 18

Michael Guralnik (2):
devlink: Introduce stats to the port object
devlink: Add statistics to port get

 include/net/devlink.h        |  28 +++++++++
 include/uapi/linux/devlink.h |   4 ++
 net/core/devlink.c           | 119 +++++++++++++++++++++++++++++++++++
 3 files changed, 151 insertions(+)
Signature · 1 line
2.17.2