Commit 33036807 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

[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: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87a596e0
...@@ -164,11 +164,9 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -164,11 +164,9 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
static struct net_device_stats loopback_stats;
static struct net_device_stats *get_stats(struct net_device *dev) 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 bytes = 0;
unsigned long packets = 0; unsigned long packets = 0;
int i; int i;
...@@ -208,7 +206,6 @@ static const struct ethtool_ops loopback_ethtool_ops = { ...@@ -208,7 +206,6 @@ static const struct ethtool_ops loopback_ethtool_ops = {
struct net_device loopback_dev = { struct net_device loopback_dev = {
.name = "lo", .name = "lo",
.get_stats = &get_stats, .get_stats = &get_stats,
.priv = &loopback_stats,
.mtu = (16 * 1024) + 20 + 20 + 12, .mtu = (16 * 1024) + 20 + 20 + 12,
.hard_start_xmit = loopback_xmit, .hard_start_xmit = loopback_xmit,
.hard_header = eth_header, .hard_header = eth_header,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment