Re: [PATCH v3 04/11] net: sched: always take reference to action

Jiri Pirko
2018-05-28T14:20:01Z

Sun, May 27, 2018 at 11:17:22PM CEST, vladbu@mellanox.com wrote:
>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.
>
>Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>