diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2017-12-12 00:35:03 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-13 19:58:41 +0100 |
commit | 039af9c66b93154b493e3088a36b251b99c9b3c4 (patch) | |
tree | 231859a76810708e956e404c882e324e7afa0961 /include/net/act_api.h | |
parent | Merge branch 'hv_netvsc-Fix-default-and-limit-of-recv-buffer' (diff) | |
download | linux-039af9c66b93154b493e3088a36b251b99c9b3c4.tar.xz linux-039af9c66b93154b493e3088a36b251b99c9b3c4.zip |
net_sched: switch to exit_batch for action pernet ops
Since we now hold RTNL lock in tc_action_net_exit(), it is good to
batch them to speedup tc action dismantle.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/act_api.h')
-rw-r--r-- | include/net/act_api.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h index 02bf409140d0..6ed9692f20bd 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -120,12 +120,19 @@ int tc_action_net_init(struct tc_action_net *tn, void tcf_idrinfo_destroy(const struct tc_action_ops *ops, struct tcf_idrinfo *idrinfo); -static inline void tc_action_net_exit(struct tc_action_net *tn) +static inline void tc_action_net_exit(struct list_head *net_list, + unsigned int id) { + struct net *net; + rtnl_lock(); - tcf_idrinfo_destroy(tn->ops, tn->idrinfo); + list_for_each_entry(net, net_list, exit_list) { + struct tc_action_net *tn = net_generic(net, id); + + tcf_idrinfo_destroy(tn->ops, tn->idrinfo); + kfree(tn->idrinfo); + } rtnl_unlock(); - kfree(tn->idrinfo); } int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb, |