Skip to contentSkip to conversation

net: dsa: mv88e6xxx: Fix u64 statistics

PATCH In review Andrew Lunn 2 participants 2 messages Feb 28, 2019

Subsystems (4)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: mv88e6xxx: Fix u64 statistics

The switch maintains u64 counters for the number of octets sent and received. These are kept as two u32's which need to be combined. Fix the combing, which wrongly worked on u16's.

Fixes 80c4627b2719 ("dsa: mv88x6xxx: Refactor getting a single statistic")
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/mv88e6xxx/chip.c +1 -1
index 12fd7ce3f1ff..9d36d2b5fbc6 100644
@@ -896,7 +896,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
 	default:
 		return U64_MAX;
 	}
-	value = (((u64)high) << 16) | low;
+	value = (((u64)high) << 32) | low;
 	return value;
 }
 
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: Andrew Lunn <[email protected]>
Date: Thu, 28 Feb 2019 18:14:03 +0100

Quoted 7 lines

The switch maintains u64 counters for the number of octets sent and received. These are kept as two u32's which need to be combined. Fix the combing, which wrongly worked on u16's.

Fixes 80c4627b2719 ("dsa: mv88x6xxx: Refactor getting a single statistic")

Applied and queued up for -stable, thanks Andrew.