• Petr Machata's avatar
    mlxsw: spectrum: Wipe xstats.backlog of down ports · ca7609ff
    Petr Machata authored
    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: 075ab8ad ("mlxsw: spectrum: Collect tclass related stats periodically")
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ca7609ff
spectrum.c 194 KB