]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Wipe xstats.backlog of down ports
authorPetr Machata <petrm@mellanox.com>
Wed, 15 Jan 2020 11:53:48 +0000 (13:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 12:16:30 +0000 (04:16 -0800)
commite2276abeb4ba47b94d4bc3921bdfa0ce5a3085be
tree00729c263f1d1271ad8cc8de5085efebcad775f2
parent67aa2ce88fe81b9dcefec0b7f7e5d752cef357c1
mlxsw: spectrum: Wipe xstats.backlog of down ports

Per-port counter cache used by Qdiscs is updated periodically, unless the
port is down. The fact that the cache is not updated for down ports is no
problem for most counters, which are relative in nature. However, backlog
is absolute in nature, and if there is a non-zero value in the cache around
the time that the port goes down, that value just stays there. This value
then leaks to offloaded Qdiscs that report non-zero backlog even if
there (obviously) is no traffic.

The HW does not keep backlog of a downed port, so do likewise: as the port
goes down, wipe the backlog value from xstats.

Fixes: 7dd377ef4f25 ("mlxsw: spectrum: Collect tclass related stats periodically")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c