aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-12-05 14:23:59 +0100
committerFelix Fietkau <nbd@nbd.name>2018-02-05 10:16:25 +0100
commit31e6016d2e41199b22577b429b8691526a4359f6 (patch)
treef9a677db364bdd026e06777f068731b81b1ff9af /target/linux/ar71xx/files
parent890e7458b0e8b62b99a3dcc50ddee8763c9a22d2 (diff)
downloadupstream-31e6016d2e41199b22577b429b8691526a4359f6.tar.gz
upstream-31e6016d2e41199b22577b429b8691526a4359f6.tar.bz2
upstream-31e6016d2e41199b22577b429b8691526a4359f6.zip
ar71xx: only access device stats in tx handler if packets were processed
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index e8eb632c77..72e6b32c63 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -999,12 +999,12 @@ static int ag71xx_tx_packets(struct ag71xx *ag, bool flush)
DBG("%s: %d packets sent out\n", ag->dev->name, sent);
- ag->dev->stats.tx_bytes += bytes_compl;
- ag->dev->stats.tx_packets += sent;
-
if (!sent)
return 0;
+ ag->dev->stats.tx_bytes += bytes_compl;
+ ag->dev->stats.tx_packets += sent;
+
netdev_completed_queue(ag->dev, sent, bytes_compl);
if ((ring->curr - ring->dirty) < (ring_size * 3) / 4)
netif_wake_queue(ag->dev);