mlxsw: spectrum: qdiscs: Collect stats for sch_red based on priomap
authorNogah Frankel <nogahf@mellanox.com>
Wed, 28 Feb 2018 09:45:01 +0000 (10:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Feb 2018 17:06:00 +0000 (12:06 -0500)
commit04cc0bf5d6ceb0ff19e8636fb39695620e587b06
tree6dab10bd074ac13e4eb46450615a640072ab24af
parent1631ab2e8d31577d65f4cf857f609ef3131ff61e
mlxsw: spectrum: qdiscs: Collect stats for sch_red based on priomap

Priority counters count packets according to their packet priority.
Collect the stats for sch_red based on these counters, so the qdisc bstats
will be the sum of counters matching the priorities marked in the qdisc
priomap.
Changing the mapping of the priorities to bands while traffic is running
can result in losing the stats of the bands qdiscs from their last dump
call to this change, as if the qdisc was unoffloaded and re-offloaded. It
will not affect the traffic behaviour according to sch_red.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Reviewed-by: Yuval Mintz <yuvalm@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c