All of lore.kernel.org
 help / color / mirror / Atom feed
* bnx2x statistics occasionally wrong by near multiples of 4GB.
@ 2013-03-15 21:03 Maciej Żenczykowski
  2013-03-15 21:56 ` [PATCH] bnx2x: fix occasional statistics off-by-4GB error Maciej Żenczykowski
  0 siblings, 1 reply; 19+ messages in thread
From: Maciej Żenczykowski @ 2013-03-15 21:03 UTC (permalink / raw)
  To: Mintz Yuval; +Cc: Linux NetDev

bnx2x_stats.h:

#define UPDATE_QSTAT(s, t) \
     do { \
              qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi); \
              qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \
      } while (0)

Looks wrong because it doesn't deal with overflow of _lo.

I'm not 100% sure if I tracked it down correctly, but I think this is
the root cause of us occasionally seeing stats (/proc/net/dev tx_bytes
in this case) jump back by roughly N*4GB and then go forward again.

In particular we saw successive reads of /proc/net/dev eth0 Transmit bytes show:

0x8F6 45356E60
0x8F4 4C8D72B9
0x8F6 5420D096

(which since this is a sum of 3 values (ucase/mcast/bcast) from all
queues, means we actually wrongly accounted for overflow twice...)

- Maciej

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-03-21 21:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15 21:03 bnx2x statistics occasionally wrong by near multiples of 4GB Maciej Żenczykowski
2013-03-15 21:56 ` [PATCH] bnx2x: fix occasional statistics off-by-4GB error Maciej Żenczykowski
2013-03-17 13:10   ` Dmitry Kravkov
2013-03-17 18:24     ` David Miller
2013-03-17 19:37       ` Eilon Greenstein
2013-03-17 20:25         ` Eric Dumazet
2013-03-17 20:53           ` Eilon Greenstein
2013-03-17 23:17             ` Eric Dumazet
2013-03-18  7:27               ` Eilon Greenstein
2013-03-18  6:18             ` Maciej Żenczykowski
2013-03-18 10:06               ` Eilon Greenstein
2013-03-18 17:13                 ` David Miller
2013-03-18 19:54                   ` Maciej Żenczykowski
2013-03-18 20:05                     ` David Miller
2013-03-18 20:06                     ` Maciej Żenczykowski
2013-03-18 20:35                       ` Eric Dumazet
2013-03-18 20:36                       ` Maciej Żenczykowski
2013-03-21 21:23                         ` Maciej Żenczykowski
2013-03-21 21:25                           ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.