Patchwork [11/12] sfc: Only count bad packets in rx_errors

login
register
mail settings
Submitter Dmitry Kravkov
Date June 8, 2010, 9:20 a.m.
Message ID <2DFD360E328B3941911E6D28B085D990107C9DA893@SJEXCHCCR01.corp.ad.broadcom.com>
Download mbox | patch
Permalink /patch/54957/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Dmitry Kravkov - June 8, 2010, 9:20 a.m.
Hi,

Different drivers include different errors in stats->rx_errors:

  bxn2	  bnx2x	  ixgbx	  sfc		  dnet	  atlx
----------------------------------------------------------------------
rx_length	rx_length	rx_length	rx_length	rx_length	rx_length
rx_over	rx_over							rx_over
rx_frame	rx_frame			rx_frame	rx_frame	rx_frame
rx_crc	rx_crc	rx_crc	rx_crc			rx_crc
		rx_fifo							rx_fifo
		rx_missed							rx_missed
						rx_symbol
								unsup_opcd
----------------------------------------------------------------------
Is there any documentation which defines what should this statistic include?

Thanks
Dmitry


-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Ben Hutchings
Sent: Wednesday, June 02, 2010 12:21 AM
To: David Miller
Cc: netdev@vger.kernel.org; linux-net-drivers@solarflare.com
Subject: [PATCH 11/12] sfc: Only count bad packets in rx_errors

rx_errors is defined as 'bad packets received', but we are currently
including various overflow errors as well.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Ben Hutchings - June 8, 2010, 6:09 p.m.
On Tue, 2010-06-08 at 02:20 -0700, Dmitry Kravkov wrote:
> Hi,
> 
> Different drivers include different errors in stats->rx_errors:

Your table didn't line up when display here.  It appears you used
6-space tabs so I've expanded them to spaces on that assumption:

>   bxn2        bnx2x       ixgbx       sfc         dnet        atlx
> ----------------------------------------------------------------------
> rx_length   rx_length   rx_length   rx_length   rx_length   rx_length
> rx_over     rx_over                                         rx_over
> rx_frame    rx_frame                rx_frame    rx_frame    rx_frame
> rx_crc      rx_crc      rx_crc      rx_crc                  rx_crc
>             rx_fifo                                         rx_fifo
>             rx_missed                                       rx_missed
>                                     rx_symbol
>                                                 unsup_opcd
> ----------------------------------------------------------------------
> Is there any documentation which defines what should this statistic include?

My references are the comments on the structure (in <linux/if_link.h>
and <linux/netdevice.h>) and an email by Donald Becker
<http://www.uwsg.iu.edu/hypermail/linux/net/0003.3/0154.html>.  The
comments could probably be expanded.

Note also that some of the statistics are combined as follows in
/proc/net/dev, which is what ifconfig uses:

Heading/subheading  Summed statistics
-----------------------------------------------------------------------------------------------
Receive/drop        rx_dropped, rx_missed_errors
Receive/frame       rx_length_errors, rx_over_errors, rx_crc_errors, rx_frame_errors
Transmit/carrier    tx_carrier_errors, tx_aborted_errors, tx_window_errors, tx_heartbeat_errors

Something that doesn't make sense to me is that rx_over_errors is
included under 'frame' rather than under 'drop'.

Ben.

Patch

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index aae3347..26b0cc2 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1518,11 +1518,8 @@  static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
 	stats->tx_window_errors = mac_stats->tx_late_collision;
 
 	stats->rx_errors = (stats->rx_length_errors +
-			    stats->rx_over_errors +
 			    stats->rx_crc_errors +
 			    stats->rx_frame_errors +
-			    stats->rx_fifo_errors +
-			    stats->rx_missed_errors +
 			    mac_stats->rx_symbol_error);
 	stats->tx_errors = (stats->tx_window_errors +
 			    mac_stats->tx_bad);