mlxsw: spectrum_qdisc: Query tclass / priomap instead of caching it
authorPetr Machata <petrm@nvidia.com>
Tue, 19 Oct 2021 08:07:05 +0000 (11:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Oct 2021 11:24:51 +0000 (12:24 +0100)
commit76ff72a7204f3a4e47345872895118149ddd57a8
treec618a15ffed89e491d9dc46711388320824b5fe3
parent6b3efbfa4e68d84e6efbcd1ff4e98f5ba1da4307
mlxsw: spectrum_qdisc: Query tclass / priomap instead of caching it

Currently when keeping track of qdiscs, mlxsw notes the TC and priomap
corresponding to each qdisc. That is fine currently, as there only ever is
one level of qdiscs to update: the direct children of ETS / PRIO. However
as deeper structures are made offloadable, ETS would need to update these
values for the complete subtree, and interim qdiscs would need to remember
to propagate the value.

Instead, reverse the responsibility: child qdiscs can ask their parent what
their TC and priomap are. ETS / PRIO know the answer right away, or there
are defaults for when the root qdisc does not assign them (e.g. when RED is
used as root qdisc). When RED and TBF become classful, they will simply
forward the request up to their parent.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c