[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1512083524.19682.29.camel@gmail.com>
Date: Thu, 30 Nov 2017 15:12:04 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org
Cc: Jiri Pirko <jiri@...lanox.com>, Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [Patch net-next] act_mirred: get rid of mirred_list_lock
spinlock
On Thu, 2017-11-30 at 14:53 -0800, Cong Wang wrote:
> TC actions are no longer freed in RCU callbacks and we should
> always have RTNL lock, so this spinlock is no longer needed.
>
> Cc: Jiri Pirko <jiri@...lanox.com>
> Cc: Jamal Hadi Salim <jhs@...atatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
> ---
> net/sched/act_mirred.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index fe6489f9c3cf..2c51952bf2d4 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -29,7 +29,6 @@
> #include <net/tc_act/tc_mirred.h>
>
> static LIST_HEAD(mirred_list);
> -static DEFINE_SPINLOCK(mirred_list_lock);
>
> static bool tcf_mirred_is_act_redirect(int action)
> {
> @@ -55,13 +54,10 @@ static void tcf_mirred_release(struct tc_action
> *a, int bind)
> struct tcf_mirred *m = to_mirred(a);
> struct net_device *dev;
>
> - /* We could be called either in a RCU callback or with RTNL
> lock held. */
> - spin_lock_bh(&mirred_list_lock);
> list_del(&m->tcfm_list);
> dev = rcu_dereference_protected(m->tcfm_dev, 1);
If RTNL is held at this point, I suggest to use
rtnl_dereference() instead of rcu_dereference_protected() to get proper
lockdep coverage.
> if (dev)
> dev_put(dev);
> - spin_unlock_bh(&mirred_list_lock);
> }
>
Powered by blists - more mailing lists