]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: Add support for IFLA_OFFLOAD_XSTATS_L3_STATS
authorPetr Machata <petrm@nvidia.com>
Wed, 2 Mar 2022 16:31:27 +0000 (18:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Mar 2022 10:37:23 +0000 (10:37 +0000)
commit6c8baf07056fb2eb7b73cbc9d15322151a2dd4a6
tree5a487b6f8f0892d2e6d688d00c5d4672e8bf65e3
parent8c92fa9ee7c4fb6cb9e96feddb267b3b5a6e434e
mlxsw: Add support for IFLA_OFFLOAD_XSTATS_L3_STATS

Spectrum machines support L3 stats by binding a counter to a RIF, a
hardware object representing a router interface. Recognize the netdevice
notifier events, NETDEV_OFFLOAD_XSTATS_*, to support enablement,
disablement, and reporting back to core.

As a netdevice gains a RIF, if L3 stats are enabled, install the counters,
and ping the core so that a userspace notification can be emitted.

Similarly, as a netdevice loses a RIF, push the as-yet-unreported
statistics to the core, so that they are not lost, and ping the core to
emit userspace notification.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c