[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d81de210f0f4a37f07cc5b990c41c11eb5281780.camel@nvidia.com>
Date: Thu, 23 May 2024 06:57:25 +0000
From: Jianbo Liu <jianbol@...dia.com>
To: "steffen.klassert@...unet.com" <steffen.klassert@...unet.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 Thu, 2024-05-23 at 08:44 +0200, Steffen Klassert wrote:
> On Thu, May 23, 2024 at 02:22:38AM +0000, Jianbo Liu wrote:
> > On Wed, 2024-05-22 at 11:34 +0200, Steffen Klassert wrote:
> > >
> > > Maybe we should directly remove the device from the xfrm_state
> > > when the decice goes down, this should catch all the cases.
> > >
> > > I think about something like this (untested) patch:
> > >
> > > diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> > > index 0c306473a79d..ba402275ab57 100644
> > > --- a/net/xfrm/xfrm_state.c
> > > +++ b/net/xfrm/xfrm_state.c
> > > @@ -867,7 +867,11 @@ int xfrm_dev_state_flush(struct net *net,
> > > struct
> > > net_device *dev, bool task_vali
> > > xfrm_state_hold(x);
> > > spin_unlock_bh(&net-
> > > > xfrm.xfrm_state_lock);
> > >
> > > - err = xfrm_state_delete(x);
> > > + spin_lock_bh(&x->lock);
> > > + err = __xfrm_state_delete(x);
> > > + xfrm_dev_state_free(x);
> > > + spin_unlock_bh(&x->lock);
> > > +
> > > xfrm_audit_state_delete(x, err ? 0
> > > :
> > > 1,
> > > task_valid)
> > > ;
> > > xfrm_state_put(x);
> > >
> > > The secpath is still attached to all skbs, but the hang on device
> > > unregister should go away.
> >
> > It didn't fix the issue.
>
> Do you have a backtrace of the ref_tracker?
>
> Is that with packet offload?
>
Yes. And it's the same trace I posted before.
ref_tracker: eth%d@...000007421424b has 1/1 users at
xfrm_dev_state_add+0xe5/0x4d0
xfrm_add_sa+0xc5c/0x11e0
xfrm_user_rcv_msg+0xfa/0x240
netlink_rcv_skb+0x54/0x100
xfrm_netlink_rcv+0x31/0x40
netlink_unicast+0x1fc/0x2c0
netlink_sendmsg+0x232/0x4a0
__sock_sendmsg+0x38/0x60
____sys_sendmsg+0x1e3/0x200
___sys_sendmsg+0x80/0xc0
__sys_sendmsg+0x51/0x90
do_syscall_64+0x40/0xe0
entry_SYSCALL_64_after_hwframe+0x46/0x4e
> Looks like we need to remove the device from the xfrm_policy
> too if packet offload is used.
Powered by blists - more mailing lists