diff options
author | Petr Machata <petrm@nvidia.com> | 2022-03-02 17:31:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-03 11:37:23 +0100 |
commit | 8d0f7d3ac6472899e6dea3b812313ee824c6745d (patch) | |
tree | 5a487b6f8f0892d2e6d688d00c5d4672e8bf65e3 /drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |
parent | mlxsw: Extract classification of router-related events to a helper (diff) | |
download | linux-8d0f7d3ac6472899e6dea3b812313ee824c6745d.tar.xz linux-8d0f7d3ac6472899e6dea3b812313ee824c6745d.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 10f32deea158..7b7b17183d10 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -4829,6 +4829,10 @@ static bool mlxsw_sp_netdevice_event_is_router(unsigned long event) case NETDEV_PRE_CHANGEADDR: case NETDEV_CHANGEADDR: case NETDEV_CHANGEMTU: + case NETDEV_OFFLOAD_XSTATS_ENABLE: + case NETDEV_OFFLOAD_XSTATS_DISABLE: + case NETDEV_OFFLOAD_XSTATS_REPORT_USED: + case NETDEV_OFFLOAD_XSTATS_REPORT_DELTA: return true; default: return false; |