]> 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)
commit8d41a7f6a71d6927af994e33bf2c85211eb30eab
tree429efc7780a59682e8be2fdc4f4e786f4727afd1
parentc2f06b45b7ab75ba1e902c0cea689d19bb5943d7
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