]> asedeno.scripts.mit.edu Git - linux.git/commit
net: sched: conditionally obtain rtnl lock in cls hw offloads API
authorVlad Buslov <vladbu@mellanox.com>
Mon, 26 Aug 2019 13:45:02 +0000 (16:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Aug 2019 21:17:43 +0000 (14:17 -0700)
commit11bd634da25735a3f2f12112d02661d462a76792
tree8c80a516c7d1b042d59d766f2a89a0b442cd5126
parentc9f14470d04830de217f9d28fcd0deffd7e8c0b1
net: sched: conditionally obtain rtnl lock in cls hw offloads API

In order to remove dependency on rtnl lock from offloads code of
classifiers, take rtnl lock conditionally before executing driver
callbacks. Only obtain rtnl lock if block is bound to devices that require
it.

Block bind/unbind code is rtnl-locked and obtains block->cb_lock while
holding rtnl lock. Obtain locks in same order in tc_setup_cb_*() functions
to prevent deadlock.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c