]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mlxsw: spectrum_qdisc: Allocate child qdiscs dynamically
authorPetr Machata <petrm@nvidia.com>
Tue, 20 Apr 2021 14:53:46 +0000 (16:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Apr 2021 23:43:13 +0000 (16:43 -0700)
commit5cbd96025330c4dacdf8c0c49203a6ef0aea21a2
tree0ae9616c125a68eb7f6409bc981c5ff39dc2b000
parentcff99e204553c500459712b523d06002a7aae18e
mlxsw: spectrum_qdisc: Allocate child qdiscs dynamically

Instead of keeping qdiscs in globally-preallocated arrays, introduce a
per-qdisc-kind value num_classes, and then allocate the necessary child
qdiscs (if any) based on that value. Since now dynamic allocation is
involved, mlxsw_sp_qdisc_replace() gets messy enough that it is worth it to
split it to two cases: a new qdisc allocation and a change of existing
qdisc. (Note that the change also includes what TC formally calls replace,
if the qdisc kind is the same.)

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