OSDN Git Service

mlxsw: spectrum_qdisc: Generalize PRIO offload to support ETS
authorPetr Machata <petrm@mellanox.com>
Wed, 18 Dec 2019 14:55:17 +0000 (14:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2019 21:32:30 +0000 (13:32 -0800)
commit7917f52ae188b87de627a892b57646abfe5a82bc
treebf70a3d59832c6c1c72a6e9d775add3ccf5eb265
parentd35eb52bd2ac7557b62bda52668f2e64dde2cf90
mlxsw: spectrum_qdisc: Generalize PRIO offload to support ETS

Thanks to the similarity between PRIO and ETS it is possible to simply
reuse most of the code for offloading PRIO Qdisc. Extract the common
functionality into separate functions, making the current PRIO handlers
thin API adapters.

Extend the new functions to pass quanta for individual bands, which allows
configuring a subset of bands as WRR. Invoke mlxsw_sp_port_ets_set() as
appropriate to de/configure WRR-ness and weight of individual bands.

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