aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2017-11-06 07:23:47 +0100
committerDavid S. Miller <davem@davemloft.net>2017-11-08 12:23:38 +0900
commit075ab8adaf4e7443159bee6412cb85434c63ed15 (patch)
tree9c2a28e8e219d5585b7e53b17b51aa4e3c72b30b /drivers/net/ethernet/mellanox/mlxsw/spectrum.h
parentmlxsw: reg: Add ext and tc-cong counter groups (diff)
downloadlinux-dev-075ab8adaf4e7443159bee6412cb85434c63ed15.tar.xz
linux-dev-075ab8adaf4e7443159bee6412cb85434c63ed15.zip
mlxsw: spectrum: Collect tclass related stats periodically
Add more statistics to be collected from the HW periodically. These stats are tclass based (beside ECN marked packet, that exist only port based). They are needed to expose RED qdisc stats and xstats correctly. 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 '')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 76ebd58b6248..e68299e6a963 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -213,6 +213,14 @@ struct mlxsw_sp_qdisc {
enum mlxsw_sp_qdisc_type type;
};
+/* No need an internal lock; At worse - miss a single periodic iteration */
+struct mlxsw_sp_port_xstats {
+ u64 ecn;
+ u64 wred_drop[TC_MAX_QUEUE];
+ u64 tail_drop[TC_MAX_QUEUE];
+ u64 backlog[TC_MAX_QUEUE];
+};
+
struct mlxsw_sp_port {
struct net_device *dev;
struct mlxsw_sp_port_pcpu_stats __percpu *pcpu_stats;
@@ -242,6 +250,7 @@ struct mlxsw_sp_port {
struct {
#define MLXSW_HW_STATS_UPDATE_TIME HZ
struct rtnl_link_stats64 stats;
+ struct mlxsw_sp_port_xstats xstats;
struct delayed_work update_dw;
} periodic_hw_stats;
struct mlxsw_sp_port_sample *sample;