net: sched: use reference counting action init
authorVlad Buslov <vladbu@mellanox.com>
Thu, 5 Jul 2018 14:24:31 +0000 (17:24 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jul 2018 03:42:29 +0000 (12:42 +0900)
commitcae422f379f37fe9105d2a113259788f989e7df5
tree1bc0e47b7a5217a4694d4b9a09be5aefb870b3b4
parent4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2
net: sched: use reference counting action init

Change action API to assume that action init function always takes
reference to action, even when overwriting existing action. This is
necessary because action API continues to use action pointer after init
function is done. At this point action becomes accessible for concurrent
modifications, so user must always hold reference to it.

Implement helper put list function to atomically release list of actions
after action API init code is done using them.

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>
net/sched/act_api.c