]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: Add multi-queue support to sch_tree_lock
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Tue, 19 Jan 2021 12:08:11 +0000 (14:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 23 Jan 2021 04:41:29 +0000 (20:41 -0800)
commitfab64ef0d855e706e5a421eb67a6ad95c35ffc66
treebe325e07b9bbe53aae8275e7fcc398524c7b06b7
parenta7a333b02886b52f4d74af82c7146f78fe29acc0
net: sched: Add multi-queue support to sch_tree_lock

The existing qdiscs that set TCQ_F_MQROOT don't use sch_tree_lock.
However, hardware-offloaded HTB will start setting this flag while also
using sch_tree_lock.

The current implementation of sch_tree_lock basically locks on
qdisc->dev_queue->qdisc, and it works fine when the tree is attached to
some queue. However, it's not the case for MQROOT qdiscs: such a qdisc
is the root itself, and its dev_queue just points to queue 0, while not
actually being used, because there are real per-queue qdiscs.

This patch changes the logic of sch_tree_lock and sch_tree_unlock to
lock the qdisc itself if it's the MQROOT.

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sch_generic.h