diff --git a/include/net/act_api.h b/include/net/act_api.h index c48b750de2fc..79cc64f32966 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -39,6 +39,7 @@ struct tc_action { struct gnet_stats_queue __percpu *cpu_qstats; struct tc_cookie __rcu *act_cookie; struct tcf_chain *goto_chain; + struct rcu_head tcfa_rcu; }; #define tcf_index common.tcfa_index #define tcf_refcnt common.tcfa_refcnt diff --git a/net/sched/act_api.c b/net/sched/act_api.c index ad0773b20d83..9241ed7a2dbf 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -73,11 +73,6 @@ static void tcf_set_action_cookie(struct tc_cookie __rcu **old_cookie, call_rcu(&old->rcu, tcf_free_cookie_rcu); } -/* XXX: For standalone actions, we don't need a RCU grace period either, because - * actions are always connected to filters and filters are already destroyed in - * RCU callbacks, so after a RCU grace period actions are already disconnected - * from filters. Readers later can not find us. - */ static void free_tcf(struct tc_action *p) { free_percpu(p->cpu_bstats); @@ -87,7 +82,7 @@ static void free_tcf(struct tc_action *p) if (p->goto_chain) tcf_action_goto_chain_fini(p); - kfree(p); + kfree_rcu(p, tcfa_rcu); } static void tcf_action_cleanup(struct tc_action *p)