Re: [PATCH] s2io: read rx_packets count from the hardware stats
From: David Miller <davem@davemloft.net>
Date: 2010-06-29 06:52:10
From: Michal Schmidt <redacted> Date: Fri, 25 Jun 2010 01:32:32 +0200
Most of the statistics the s2io driver provides in /proc/net/dev it reads directly from the hardware counters. For some reason it does not do that for rx_packets. It counts rx_packets purely in software. A customer reported a bug where in /proc/net/dev the 'multicast' counter was increasing faster than 'packets' ( = rx_packets in the source code). This confuses userspace, especially snmpd. The hardware provides a counter for the total number of received frames (RMAC_VLD_FRMS) which the driver can use for the rx_packets statistic. By reading both statistics from the hardware it makes sure that all multicast frames are included in the total. The customer tested a patch like this (only modified for RHEL5) with S2io Inc. Xframe II 10Gbps Ethernet (rev 02) and it fixed the problem. Signed-off-by: Michal Schmidt <redacted>
Please also use the rmac_data_octets HW statistic for rx_bytes otherwise rx_bytes will be out of sync with the other stats too.