[PATCH] myri10ge: 64bit slice stats

Subsystems: networking drivers, the rest

STALE5522d

3 messages, 2 authors, 2011-06-20 · open the first message on its own page

[PATCH] myri10ge: 64bit slice stats

From: Jon Mason <hidden>
Date: 2011-06-20 18:46:40

There is a potential issue of internal 32bit stats wrapping before
updating the external 64bit stats, thus leading to incorrect stats.
Since there is no hardware necessity for these counters to be 32bit,
change them to be 64bit to avoid this issue.

Patch suggested by Eric Dumazet.

Signed-off-by: Jon Mason <redacted>
---
 drivers/net/myri10ge/myri10ge.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 04e10f4..2a51de1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -170,12 +170,12 @@ struct myri10ge_rx_done {
 };
 
 struct myri10ge_slice_netstats {
-	unsigned long rx_packets;
-	unsigned long tx_packets;
-	unsigned long rx_bytes;
-	unsigned long tx_bytes;
-	unsigned long rx_dropped;
-	unsigned long tx_dropped;
+	u64 rx_packets;
+	u64 tx_packets;
+	u64 rx_bytes;
+	u64 tx_bytes;
+	u64 rx_dropped;
+	u64 tx_dropped;
 };
 
 struct myri10ge_slice_state {
-- 
1.7.5.4

Re: [PATCH] myri10ge: 64bit slice stats

From: Eric Dumazet <hidden>
Date: 2011-06-20 18:49:21

Le lundi 20 juin 2011 à 13:46 -0500, Jon Mason a écrit :
quoted hunk
There is a potential issue of internal 32bit stats wrapping before
updating the external 64bit stats, thus leading to incorrect stats.
Since there is no hardware necessity for these counters to be 32bit,
change them to be 64bit to avoid this issue.

Patch suggested by Eric Dumazet.

Signed-off-by: Jon Mason <redacted>
---
 drivers/net/myri10ge/myri10ge.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 04e10f4..2a51de1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -170,12 +170,12 @@ struct myri10ge_rx_done {
 };
 
 struct myri10ge_slice_netstats {
-	unsigned long rx_packets;
-	unsigned long tx_packets;
-	unsigned long rx_bytes;
-	unsigned long tx_bytes;
-	unsigned long rx_dropped;
-	unsigned long tx_dropped;
+	u64 rx_packets;
+	u64 tx_packets;
+	u64 rx_bytes;
+	u64 tx_bytes;
+	u64 rx_dropped;
+	u64 tx_dropped;
 };
 
 struct myri10ge_slice_state {
Hmm, no sorry, this wont work on 32bit arches :(

Please take a look at various patches addressing this problem.


Re: [PATCH] myri10ge: 64bit slice stats

From: Eric Dumazet <hidden>
Date: 2011-06-20 18:52:19

Le lundi 20 juin 2011 à 20:49 +0200, Eric Dumazet a écrit :
Hmm, no sorry, this wont work on 32bit arches :(

Please take a look at various patches addressing this problem.
For example take a look at the once sent some hours ago :

http://patchwork.ozlabs.org/patch/101128/


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help