Re: [PATCH net-next-2.6 1/3] be2net: fix netdev_stats_update
From: Stephen Hemminger <hidden>
Date: 2011-06-27 18:44:01
From: Stephen Hemminger <hidden>
Date: 2011-06-27 18:44:01
On Mon, 27 Jun 2011 19:20:41 +0200 Eric Dumazet [off-list ref] wrote:
Le lundi 27 juin 2011 à 09:43 -0700, Stephen Hemminger a écrit :quoted
On Mon, 27 Jun 2011 12:10:48 +0530 Sathya Perla [off-list ref] wrote:quoted
Problem initially reproted and fixed by Eric Dumazet [off-list ref] netdev_stats_update() resets netdev->stats and then accumulates stats from various rings. This is wrong as stats readers can sometimes catch zero values. Use temporary variables instead for accumulating per-ring values. Signed-off-by: Sathya Perla <redacted>Should also use u64_stats_sync to ensure correct rollover or 32 bit SMP platform.These are "unsigned long" fields, you dont need u64_stats_sync.
The source fields (in be.h) are u64, but since destination is unsigned long that works.