[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3a26acab9bf5b010679debe366c9da36b42a567a.camel@nvidia.com>
Date: Fri, 2 Aug 2024 08:27:56 +0000
From: Jianbo Liu <jianbol@...dia.com>
To: Tariq Toukan <tariqt@...dia.com>, "jv@...sburgh.net" <jv@...sburgh.net>,
"andy@...yhouse.net" <andy@...yhouse.net>, "edumazet@...gle.com"
<edumazet@...gle.com>, "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>
CC: Leon Romanovsky <leonro@...dia.com>, Gal Pressman <gal@...dia.com>, Saeed
Mahameed <saeedm@...dia.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "liuhangbin@...il.com" <liuhangbin@...il.com>
Subject: Re: [PATCH net V2 3/3] bonding: change ipsec_lock from spin lock to
mutex
On Thu, 2024-08-01 at 12:25 +0200, Paolo Abeni wrote:
> On 8/1/24 11:49, Tariq Toukan wrote:
> > diff --git a/drivers/net/bonding/bond_main.c
> > b/drivers/net/bonding/bond_main.c
> > index e6514ef7ad89..0f8d1b29dc7f 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -436,41 +436,34 @@ static int bond_ipsec_add_sa(struct
> > xfrm_state *xs,
> > if (!bond_dev)
> > return -EINVAL;
> >
> > - rcu_read_lock();
> > bond = netdev_priv(bond_dev);
> > slave = rcu_dereference(bond->curr_active_slave);
> > - if (!slave) {
> > - rcu_read_unlock();
>
> I'm sorry, I probably was not clear with my question on the previous
> revision.
>
> I asked if this code is under RTNL lock already, if so we could
> replace
> rcu_dereference with rtnl_dereference() and drop the rcu lock.
>
> You stated this block is not under the RTNL lock, so we still need
> the
> rcu lock around rcu_dereference().
>
> Same thing in bond_ipsec_del_sa().
Sure, I will add back. Thanks!
>
> Please have a run with CONFIG_PROVE_RCU, it should splat on such
> dereference.
>
> Thanks,
>
> Paolo
>
Powered by blists - more mailing lists