mlxsw: spectrum: qdiscs: prio: Delete child qdiscs when removing bands
authorNogah Frankel <nogahf@mellanox.com>
Wed, 28 Feb 2018 09:45:05 +0000 (10:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Feb 2018 17:06:01 +0000 (12:06 -0500)
commit98ceb7b6d64552f995973be1a0ee9af0bf85fb3d
treee57f1c0b05c990e8646ae2cc4cefce28717f0ec0
parent23f2b4048cc49d786c452f681dd5d8920ca095a7
mlxsw: spectrum: qdiscs: prio: Delete child qdiscs when removing bands

When the number the bands of sch_prio is decreased, child qdiscs on the
deleted bands would get deleted as well.
This change and deletions are being done under sch_tree_lock of the
sch_prio qdisc. Part of the destruction of qdisc is unoffloading it, if
it is offloaded. Un-offloading can't be done inside this lock.
Move the offload command to be done before reducing the number of bands,
so unoffloading of the qdiscs that are about to be deleted could be done
outside of the lock.

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
net/sched/sch_prio.c