Re: [PATCH 1/5] net: mvneta: increase the 64-bit rx/tx stats out of the hot path
From: Willy Tarreau <w@1wt.eu>
Date: 2014-01-13 03:06:55
On Sun, Jan 12, 2014 at 04:49:52PM -0800, Eric Dumazet wrote:
On Sun, 2014-01-12 at 10:31 +0100, Willy Tarreau wrote:quoted
Better count packets and bytes in the stack and on 32 bit then accumulate them at the end for once. This saves two memory writes and two memory barriers per packet. The incoming packet rate was increased by 4.7% on the Openblocks AX3 thanks to this. Cc: Thomas Petazzoni <redacted> Cc: Gregory CLEMENT <redacted> Signed-off-by: Willy Tarreau <w@1wt.eu> --- drivers/net/ethernet/marvell/mvneta.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)Reviewed-by: Eric Dumazet <edumazet@google.com> Note that with such a cost, one has to wonder why we keep 64bit stats for this NIC on 32bit hosts...
At least this avoids wrapping if stats are not retrieved often enough. As someone who had to support 32-bit stats in production on a firewall running on kernel 2.4, I can say it really becomes a problem to graph activity if stats are not collected as often as every 30 seconds, which is short in certain environments. Thanks, Willy