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>
This commit is contained in:
Nogah Frankel 2016-09-16 15:05:38 +02:00 • committed by David S. Miller
commit fc1bbb0f18
2 changed files with 127 additions and 7 deletions