]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_qdisc: Include MC TCs in Qdisc counters
authorPetr Machata <petrm@mellanox.com>
Wed, 15 Jan 2020 11:53:49 +0000 (13:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 12:16:30 +0000 (04:16 -0800)
commite747f452d37ef6efb867bf5cb4c47b6e6089d291
treea7a5552a426e701b4f4d00fcf43c8d789e4c487b
parente2276abeb4ba47b94d4bc3921bdfa0ce5a3085be
mlxsw: spectrum_qdisc: Include MC TCs in Qdisc counters

mlxsw configures Spectrum in such a way that BUM traffic is passed not
through its nominal traffic class TC, but through its MC counterpart TC+8.
However, when collecting statistics, Qdiscs only look at the nominal TC and
ignore the MC TC.

Add two helpers to compute the value for logical TC from the constituents,
one for backlog, the other for tail drops. Use them throughout instead of
going through the xstats pointer directly.

Counters for TX bytes and packets are deduced from packet priority
counters, and therefore already include BUM traffic. wred_drop counter is
irrelevant on MC TCs, because RED is not enabled on them.

Fixes: 5a5bc736ee39 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports")
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_qdisc.c