netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats
@ 2007-04-10 17:29 Eric Dumazet
  2007-04-10 20:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2007-04-10 17:29 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, Rusty Russel

Hi David

Please find this patch against net-2.6.22

Thank you

[PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats

Rusty added a new 'stats' field to struct net_device.

loopback driver can use it instead of declaring another struct net_device_stats
This saves some memory.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 6df673a..6ba6ed2 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -164,11 +164,9 @@ #endif
 	return 0;
 }
 
-static struct net_device_stats loopback_stats;
-
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
-	struct net_device_stats *stats = &loopback_stats;
+	struct net_device_stats *stats = &dev->stats;
 	unsigned long bytes = 0;
 	unsigned long packets = 0;
 	int i;
@@ -208,7 +206,6 @@ static const struct ethtool_ops loopback
 struct net_device loopback_dev = {
 	.name	 		= "lo",
 	.get_stats		= &get_stats,
-	.priv			= &loopback_stats,
 	.mtu			= (16 * 1024) + 20 + 20 + 12,
 	.hard_start_xmit	= loopback_xmit,
 	.hard_header		= eth_header,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats
  2007-04-10 17:29 [PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats Eric Dumazet
@ 2007-04-10 20:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-04-10 20:26 UTC (permalink / raw)
  To: dada1; +Cc: netdev, rusty

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Tue, 10 Apr 2007 19:29:12 +0200

> Hi David
> 
> Please find this patch against net-2.6.22
> 
> Thank you
> 
> [PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats
> 
> Rusty added a new 'stats' field to struct net_device.
> 
> loopback driver can use it instead of declaring another struct net_device_stats
> This saves some memory.
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-10 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10 17:29 [PATCH] NET : loopback driver can use loopback_dev integrated net_device_stats Eric Dumazet
2007-04-10 20:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).