[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZlWjKHseiI+cfHiR@gauss3.secunet.de>
Date: Tue, 28 May 2024 11:26:00 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Jianbo Liu <jianbol@...dia.com>
CC: Leon Romanovsky <leonro@...dia.com>, "edumazet@...gle.com"
<edumazet@...gle.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"fw@...len.de" <fw@...len.de>
Subject: Re: [PATCH net] net: drop secpath extension before skb deferral free
On Tue, May 28, 2024 at 09:02:49AM +0000, Jianbo Liu wrote:
> On Tue, 2024-05-28 at 10:44 +0200, Steffen Klassert wrote:
> > On Mon, May 27, 2024 at 09:40:23AM +0200, Steffen Klassert wrote:
> > > On Thu, May 23, 2024 at 03:26:22PM +0000, Jianbo Liu wrote:
> > > > On Thu, 2024-05-23 at 12:00 +0200, Steffen Klassert wrote:
> > > > >
> > > > > Hm, interesting.
> > > > >
> > > > > Can you check if xfrm_dev_state_free() is triggered in that
> > > > > codepath
> > > > > and if it actually removes the device from the states?
> > > > >
> > > >
> > > > xfrm_dev_state_free is not triggered. I think it's because I did
> > > > "ip x
> > > > s delall" before unregister netdev.
> > >
> > > Yes, likely. So we can't defer the device removal to the state free
> > > functions, we always need to do that on state delete.
> >
> > The only (not too complicated) solution I see so far is to
> > free the device early, along with the state delete function:
> >
> > diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> > index 649bb739df0d..bfc71d2daa6a 100644
> > --- a/net/xfrm/xfrm_state.c
> > +++ b/net/xfrm/xfrm_state.c
> > @@ -721,6 +721,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
> > sock_put(rcu_dereference_raw(x->encap_sk));
> >
> > xfrm_dev_state_delete(x);
> > + xfrm_dev_state_free(x);
> >
>
> Still hit "scheduling while atomic" issue because __xfrm_state_delete
> is called in state's spin lock.
Grmpf. Yes, apparently.
Unfortunately I don't have a NIC to test installed currently.
Powered by blists - more mailing lists