aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/loopback.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r--drivers/net/loopback.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 4b0e30b564e5..2d9663a1c54d 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -64,7 +64,6 @@ struct pcpu_lstats {
64 u64 packets; 64 u64 packets;
65 u64 bytes; 65 u64 bytes;
66 struct u64_stats_sync syncp; 66 struct u64_stats_sync syncp;
67 unsigned long drops;
68}; 67};
69 68
70/* 69/*
@@ -90,8 +89,7 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
90 lb_stats->bytes += len; 89 lb_stats->bytes += len;
91 lb_stats->packets++; 90 lb_stats->packets++;
92 u64_stats_update_end(&lb_stats->syncp); 91 u64_stats_update_end(&lb_stats->syncp);
93 } else 92 }
94 lb_stats->drops++;
95 93
96 return NETDEV_TX_OK; 94 return NETDEV_TX_OK;
97} 95}
@@ -101,7 +99,6 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
101{ 99{
102 u64 bytes = 0; 100 u64 bytes = 0;
103 u64 packets = 0; 101 u64 packets = 0;
104 u64 drops = 0;
105 int i; 102 int i;
106 103
107 for_each_possible_cpu(i) { 104 for_each_possible_cpu(i) {
@@ -115,14 +112,11 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
115 tbytes = lb_stats->bytes; 112 tbytes = lb_stats->bytes;
116 tpackets = lb_stats->packets; 113 tpackets = lb_stats->packets;
117 } while (u64_stats_fetch_retry(&lb_stats->syncp, start)); 114 } while (u64_stats_fetch_retry(&lb_stats->syncp, start));
118 drops += lb_stats->drops;
119 bytes += tbytes; 115 bytes += tbytes;
120 packets += tpackets; 116 packets += tpackets;
121 } 117 }
122 stats->rx_packets = packets; 118 stats->rx_packets = packets;
123 stats->tx_packets = packets; 119 stats->tx_packets = packets;
124 stats->rx_dropped = drops;
125 stats->rx_errors = drops;
126 stats->rx_bytes = bytes; 120 stats->rx_bytes = bytes;
127 stats->tx_bytes = bytes; 121 stats->tx_bytes = bytes;
128 return stats; 122 return stats;