diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2018-07-05 17:24:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-08 06:42:28 +0300 |
commit | 3f7c72bc4227b169ba2c924a7987324e24bbc4b2 (patch) | |
tree | e7f4629275f0a29d10c25af239f9d4366435f1ec /include/net | |
parent | 789871bb2a0381425b106d2a995bde1460d35a34 (diff) |
net: sched: always take reference to action
Without rtnl lock protection it is no longer safe to use pointer to tc
action without holding reference to it. (it can be destroyed concurrently)
Remove unsafe action idr lookup function. Instead of it, implement safe tcf
idr check function that atomically looks up action in idr and increments
its reference and bind counters. Implement both action search and check
using new safe function
Reference taken by idr check is temporal and should not be accounted by
userspace clients (both logically and to preserver current API behavior).
Subtract temporal reference when dumping action to userspace using existing
tca_get_fill function arguments.
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
0 files changed, 0 insertions, 0 deletions