net: sched: flower: don't check for rtnl on head dereference
authorVlad Buslov <vladbu@mellanox.com>
Thu, 21 Mar 2019 13:17:33 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 21:32:17 +0000 (14:32 -0700)
commite474619a2498c57f7f0ed8b4abb29d6c62e2393b
tree25c34d5703e6a1d5c76f9983e982a8aa5bedd83f
parent31f1a0e37cacfd764df5e45e6d91b9a959a5282f
net: sched: flower: don't check for rtnl on head dereference

Flower classifier only changes root pointer during init and destroy. Cls
API implements reference counting for tcf_proto, so there is no danger of
concurrent access to tp when it is being destroyed, even without protection
provided by rtnl lock.

Implement new function fl_head_dereference() to dereference tp->root
without checking for rtnl lock. Use it in all flower function that obtain
head pointer instead of rtnl_dereference().

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c