diff options
author | 2016-09-16 15:05:38 +0200 | |
---|---|---|
committer | 2016-09-18 22:33:42 -0400 | |
commit | fc1bbb0f1831cc22326c86fb21d88cca44999b3e (patch) | |
tree | 9ac04fd87ecd80fd0a46b03b48748ba06c8075d7 /drivers/net/ethernet/mellanox/mlxsw/spectrum.h | |
parent | net: core: Add offload stats to if_stats_msg (diff) | |
download | linux-dev-fc1bbb0f1831cc22326c86fb21d88cca44999b3e.tar.xz linux-dev-fc1bbb0f1831cc22326c86fb21d88cca44999b3e.zip |
mlxsw: spectrum: Implement offload stats ndo and expose HW stats by default
Change the default statistics ndo to return HW statistics
(like the one returned by ethtool_ops).
The HW stats are collected to a cache by delayed work every 1 sec.
Implement the offload stat ndo.
Add a function to get SW statistics, to be called from this function.
Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h index 969c250b3048..49f4cafce148 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h @@ -361,6 +361,11 @@ struct mlxsw_sp_port { struct list_head vports_list; /* TC handles */ struct list_head mall_tc_list; + struct { + #define MLXSW_HW_STATS_UPDATE_TIME HZ + struct rtnl_link_stats64 *cache; + struct delayed_work update_dw; + } hw_stats; }; struct mlxsw_sp_port *mlxsw_sp_port_lower_dev_hold(struct net_device *dev); |