Skip to contentSkip to conversation

net: dsa: tag_qca: fix doubled Tx statistics

PATCH In review Alexander Lobakin 3 participants 3 messages Jan 15, 2020 – Jan 16, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: tag_qca: fix doubled Tx statistics

DSA subsystem takes care of netdev statistics since commit 4ed70ce9f01c ("net: dsa: Refactor transmit path to eliminate duplication"), so any accounting inside tagger callbacks is redundant and can lead to messing up the stats.
This bug is present in Qualcomm tagger since day 0.

Fixes cafdc45c949b ("net-next: dsa: add Qualcomm tag RX/TX handler")
---
 net/dsa/tag_qca.c | 3 ---
 1 file changed, 3 deletions(-)
net/dsa/tag_qca.c +0 -3
index c95885215525..c8a128c9e5e0 100644
@@ -33,9 +33,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	u16 *phdr, hdr;
 
-	dev->stats.tx_packets++;
-	dev->stats.tx_bytes += skb->len;
-
 	if (skb_cow_head(skb, 0) < 0)
 		return NULL;
 
Signature · 1 line
2.25.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexander Lobakin

DSA subsystem takes care of netdev statistics since commit 4ed70ce9f01c ("net: dsa: Refactor transmit path to eliminate duplication"), so any accounting inside tagger callbacks is redundant and can lead to messing up the stats.
This bug is present in Qualcomm tagger since day 0.

Fixes cafdc45c949b ("net-next: dsa: add Qualcomm tag RX/TX handler")
Signature · 1 line
Florian
maintainer
#2 lore raw
In reply to Alexander Lobakin

From: Alexander Lobakin <[email protected]>
Date: Wed, 15 Jan 2020 11:56:52 +0300

Quoted 9 lines

DSA subsystem takes care of netdev statistics since commit 4ed70ce9f01c ("net: dsa: Refactor transmit path to eliminate duplication"), so any accounting inside tagger callbacks is redundant and can lead to messing up the stats.
This bug is present in Qualcomm tagger since day 0.

Fixes cafdc45c949b ("net-next: dsa: add Qualcomm tag RX/TX handler")

Applied and queued up for -stable.