Patchwork [net-next-2.6] atm: remove a net_device_stats clear

login
register
mail settings
Submitter Eric Dumazet
Date Aug. 18, 2010, 8:44 p.m.
Message ID <1282164274.2328.2.camel@edumazet-laptop>
Download mbox | patch
Permalink /patch/62088/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Aug. 18, 2010, 8:44 p.m.
Le mercredi 18 août 2010 à 13:10 -0700, David Miller a écrit :
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 18 Aug 2010 08:33:04 -0700
> 
> > On Wed, 18 Aug 2010 09:04:24 +0200
> > Tobias Klauser <tklauser@distanz.ch> 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 :-)

To be fair, we accepted some bits like that in the past ;)

[PATCH net-next-2.6] atm: remove a net_device_stats clear

No need to clear device stats in lec_open()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/atm/lec.c |    1 -
1 file changed, 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Aug. 19, 2010, 7:15 a.m.
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 18 Aug 2010 22:44:34 +0200

> Le mercredi 18 août 2010 à 13:10 -0700, David Miller a écrit :
>> Yep, both the ether1 and ether3 patch have this problem.  Looks
>> like we'll see v4 coming some :-)
> 
> To be fair, we accepted some bits like that in the past ;)

Yes, but let's nip it in the butt immediately when we do
notice it :-)

> [PATCH net-next-2.6] atm: remove a net_device_stats clear
> 
> No need to clear device stats in lec_open()
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/atm/lec.c b/net/atm/lec.c
index d98bde1..181d70c 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -220,7 +220,6 @@  static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
 static int lec_open(struct net_device *dev)
 {
 	netif_start_queue(dev);
-	memset(&dev->stats, 0, sizeof(struct net_device_stats));
 
 	return 0;
 }