Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-25 Thread Eric Dumazet
On Mon, 2017-08-21 at 14:13 -0700, David Miller wrote: > From: Eric Dumazet > Date: Fri, 18 Aug 2017 20:40:01 -0700 > > > Let look at tun->pcpu_stats, for example. > > > > It is allocated at line 1831, before the register_netdevice() > > > > drivers/net/tun.c does not provide ndo_init() > > I

Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-21 Thread David Miller
From: Eric Dumazet Date: Fri, 18 Aug 2017 20:40:01 -0700 > Let look at tun->pcpu_stats, for example. > > It is allocated at line 1831, before the register_netdevice() > > drivers/net/tun.c does not provide ndo_init() I see the problem now. And it's done this way because several steps need to

Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-18 Thread Eric Dumazet
On Fri, 2017-08-18 at 15:58 -0700, David Miller wrote: > From: Eric Dumazet > Date: Fri, 18 Aug 2017 06:13:49 -0700 > > > On Thu, 2017-08-17 at 22:21 -0700, David Miller wrote: > >> From: Eric Dumazet > >> Date: Thu, 17 Aug 2017 15:30:40 -0700 > >> > >> > So we do not really know if we need to

Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-18 Thread David Miller
From: Eric Dumazet Date: Fri, 18 Aug 2017 06:13:49 -0700 > On Thu, 2017-08-17 at 22:21 -0700, David Miller wrote: >> From: Eric Dumazet >> Date: Thu, 17 Aug 2017 15:30:40 -0700 >> >> > So we do not really know if we need to clean up or not. >> >> We always know, the answer is that whenever reg

Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-18 Thread Eric Dumazet
On Thu, 2017-08-17 at 22:21 -0700, David Miller wrote: > From: Eric Dumazet > Date: Thu, 17 Aug 2017 15:30:40 -0700 > > > So we do not really know if we need to clean up or not. > > We always know, the answer is that whenever register_netdev() fails we > never need to perform any cleanup which i

Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-17 Thread David Miller
From: Eric Dumazet Date: Thu, 17 Aug 2017 15:30:40 -0700 > So we do not really know if we need to clean up or not. We always know, the answer is that whenever register_netdev() fails we never need to perform any cleanup which is done by priv_destructor. > Any idea how to fix the issue ? Your p

[RFC] about net: Fix inconsistent teardown and release of private netdev state.

2017-08-17 Thread Eric Dumazet
David If I read correctly this commit : cf124db566e6b036b8bcbe8decbed740bdfac8c6 ("net: Fix inconsistent teardown and release of private netdev state.") We have problems in drivers providing priv_destructor and handling a failure in register_netdevice() register_netdevice() might have called ->p