]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: unlock rules update API
authorVlad Buslov <vladbu@mellanox.com>
Mon, 11 Feb 2019 08:55:48 +0000 (10:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 18:41:33 +0000 (13:41 -0500)
commitce31671505e4b0e59294a3135c2fcd93e3fb231b
tree429efc7780a59682e8be2fdc4f4e786f4727afd1
parent6c4bd220cbe325c3bf83787d40cbf43ae3f53744
net: sched: unlock rules update API

Register netlink protocol handlers for message types RTM_NEWTFILTER,
RTM_DELTFILTER, RTM_GETTFILTER as unlocked. Set rtnl_held variable that
tracks rtnl mutex state to be false by default.

Introduce tcf_proto_is_unlocked() helper that is used to check
tcf_proto_ops->flag to determine if ops can be called without taking rtnl
lock. Manually lookup Qdisc, class and block in rule update handlers.
Verify that both Qdisc ops and proto ops are unlocked before using any of
their callbacks, and obtain rtnl lock otherwise.

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