# Re: \[PATCH v2\] ether1: Use net\_device\_stats from struct net\_device

- From: Tobias Klauser \<tklauser@distanz.ch\>
- Date: 2010-08-19 06:14:31 
- List: netdev
- Page: https://ratatoskr.run/netdev/2010/08/8555242
- Thread: https://ratatoskr.run/linux-arm-kernel/2010/08/8555106/t.md

```text
On 2010-08-18 at 22:10:43 +0200, David Miller [ref] wrote:
> From: Stephen Hemminger <redacted>
> Date: Wed, 18 Aug 2010 08:33:04 -0700
> 
> > On Wed, 18 Aug 2010 09:04:24 +0200
> > Tobias Klauser [ref] wrote:
> > 
> >>  
> >> -	memset (&priv(dev)->stats, 0, sizeof (struct net_device_stats));
> >> +	memset(&dev->stats, 0, sizeof(struct net_device_stats));
> > 
> > This is incorrect, just remove the memset.  The stats are initialized
> > when device is created.  The Linux device driver convention is to
> > keep stats when device is set down and brought back up; that is what
> > the majority of other drivers do.
> 
> Yep, both the ether1 and ether3 patch have this problem.  Looks
> like we'll see v4 coming some :-)

Thanks a lot. I'll send another updated patch. Hope I get it right this
time :-)

AFAICS there are a few other network drivers having the same problem,
I'll send patches for those too.
```
