[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1314013658.2307.21.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Mon, 22 Aug 2011 13:47:38 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Sathya Perla <sathya.perla@...lex.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 3/5] be2net: fix erx->rx_drops_no_frags wrap
around
Le lundi 22 août 2011 à 13:43 +0200, Eric Dumazet a écrit :
> This adds a race for lockless SNMP readers (in be_get_stats64())
>
> They can see the 32bit value going backward.
>
> You have to be very careful to read the *acc once, and write it once.
The "write once" is the only requirement.
Something like :
u32 newval = hi(*acc) + val;
if (wrapped)
newval += 65536;
ACCESS_ONCE(*acc) = newval;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists