net: sched: flower: handle concurrent mask insertion
authorVlad Buslov <vladbu@mellanox.com>
Thu, 21 Mar 2019 13:17:38 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 21:32:17 +0000 (14:32 -0700)
commit195c234d15c9e93c7ee60b7d32067a9937e611a5
treecc2ffffdb0e10f09d7a03b2ac7f943d7d1d16ebe
parentf48ef4d5b083c9273d754246e2220d98f3aedd7d
net: sched: flower: handle concurrent mask insertion

Without rtnl lock protection masks with same key can be inserted
concurrently. Insert temporary mask with reference count zero to masks
hashtable. This will cause any concurrent modifications to retry.

Wait for rcu grace period to complete after removing temporary mask from
masks hashtable to accommodate concurrent readers.

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