Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2012 10:20:10 -0400
From:      Andrew Boyer <aboyer@averesystems.com>
To:        freebsd-net@freebsd.org
Subject:   [patch] e1000 stats cleanup
Message-ID:  <1B3C868C-6CA7-40A0-88A2-315EE6B95BDB@averesystems.com>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_10FF126D-3158-48F4-BDA7-2E21CA77CA6D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

This patch fixes a nit in the em, lem, and igb driver statistics, =
similar to what I proposed for ixgbe a few days ago.  Increment =
adapter->dropped_pkts instead of if_ierrors because if_ierrors is =
overwritten by hw stats collection.

Comments welcome.

-Andrew


--Apple-Mail=_10FF126D-3158-48F4-BDA7-2E21CA77CA6D
Content-Disposition: attachment;
	filename=e1000_stats.diff
Content-Type: application/octet-stream;
	name="e1000_stats.diff"
Content-Transfer-Encoding: 7bit

Index: sys/dev/e1000/if_igb.c
===================================================================
--- sys/dev/e1000/if_igb.c	(revision 239139)
+++ sys/dev/e1000/if_igb.c	(working copy)
@@ -4759,7 +4759,7 @@
 		/* Make sure all segments of a bad packet are discarded */
 		if (((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0) ||
 		    (rxr->discard)) {
-			ifp->if_ierrors++;
+			adapter->dropped_pkts++;
 			++rxr->rx_discarded;
 			if (!eop) /* Catch subsequent segs */
 				rxr->discard = TRUE;
Index: sys/dev/e1000/if_lem.c
===================================================================
--- sys/dev/e1000/if_lem.c	(revision 239139)
+++ sys/dev/e1000/if_lem.c	(working copy)
@@ -3562,7 +3561,7 @@
 				adapter->lmp = NULL;
 			}
 		} else {
-			ifp->if_ierrors++;
+			adapter->dropped_pkts++;
 discard:
 			/* Reuse loaded DMA map and just update mbuf chain */
 			mp = adapter->rx_buffer_area[i].m_head;
Index: sys/dev/e1000/if_em.c
===================================================================
--- sys/dev/e1000/if_em.c	(revision 239139)
+++ sys/dev/e1000/if_em.c	(working copy)
@@ -4434,7 +4434,7 @@
 
 		if ((cur->errors & E1000_RXD_ERR_FRAME_ERR_MASK) ||
 		    (rxr->discard == TRUE)) {
-			ifp->if_ierrors++;
+			adapter->dropped_pkts++;
 			++rxr->rx_discarded;
 			if (!eop) /* Catch subsequent segs */
 				rxr->discard = TRUE;

--Apple-Mail=_10FF126D-3158-48F4-BDA7-2E21CA77CA6D
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--------------------------------------------------
Andrew Boyer	aboyer@averesystems.com





--Apple-Mail=_10FF126D-3158-48F4-BDA7-2E21CA77CA6D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1B3C868C-6CA7-40A0-88A2-315EE6B95BDB>