Skip to contentSkip to conversation

mv643xx_eth: Fix ethtool stats

PATCH New Maxime Bizon 3 participants 3 messages Oct 3, 2006 – Oct 5, 2006

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

PATCH 1/1 mv643xx_eth: Fix ethtool stats

Some stats reported by ethtool -S on mv643xx_eth device are cleared between each call.

Is it the wanted behaviour ? If not, the attached patch fixes it.

drivers/net/mv643xx_eth.c renamed from drivers/net/mv643xx_eth.c.orig +2 -2
@@ -2156,7 +2156,7 @@
 	for (offset = ETH_MIB_BAD_OCTETS_RECEIVED;
 			offset <= ETH_MIB_FRAMES_1024_TO_MAX_OCTETS;
 			offset += 4)
-		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
+		*(u32 *)((char *)p + offset) += read_mib(mp, offset);
 
 	p->good_octets_sent += read_mib(mp, ETH_MIB_GOOD_OCTETS_SENT_LOW);
 	p->good_octets_sent +=
@@ -2165,7 +2165,7 @@
 	for (offset = ETH_MIB_GOOD_FRAMES_SENT;
 			offset <= ETH_MIB_LATE_COLLISION;
 			offset += 4)
-		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
+		*(u32 *)((char *)p + offset) += read_mib(mp, offset);
 }
 
 /*
Signature · 1 line
Maxime
#1 lore raw

PATCH 1/1 mv643xx_eth: Fix ethtool stats

From: Maxime Bizon <[email protected]>

Some stats reported by ethtool -S on mv643xx_eth device are cleared between each call. This patch fixes it.

---

Thanks Maxime.

drivers/net/mv643xx_eth.c renamed from drivers/net/mv643xx_eth.c.orig +2 -2
@@ -2156,7 +2156,7 @@
 	for (offset = ETH_MIB_BAD_OCTETS_RECEIVED;
 			offset <= ETH_MIB_FRAMES_1024_TO_MAX_OCTETS;
 			offset += 4)
-		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
+		*(u32 *)((char *)p + offset) += read_mib(mp, offset);
 
 	p->good_octets_sent += read_mib(mp, ETH_MIB_GOOD_OCTETS_SENT_LOW);
 	p->good_octets_sent +=
@@ -2165,7 +2165,7 @@
 	for (offset = ETH_MIB_GOOD_FRAMES_SENT;
 			offset <= ETH_MIB_LATE_COLLISION;
 			offset += 4)
-		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
+		*(u32 *)((char *)p + offset) += read_mib(mp, offset);
 }
 
 /*