From 126a39ce60bf324627b12135e7f5bce41bbc3c3f Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Sun, 23 Sep 2012 22:53:39 +0000 Subject: [PATCH] This patch fixes a nit in the em, lem, and igb driver statistics. Increment adapter->dropped_pkts instead of if_ierrors because if_ierrors is overwritten by hw stats collection. Submitted by: Andrew Boyer Reviewed by: Jack F Vogel MFC after: 2 weeks --- sys/dev/e1000/if_em.c | 2 +- sys/dev/e1000/if_igb.c | 2 +- sys/dev/e1000/if_lem.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 60e670865d03..63f399f130e9 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4436,7 +4436,7 @@ em_rxeof(struct rx_ring *rxr, int count, int *done) 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; diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 085ebc43fab7..cd91ad4e1ade 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -4759,7 +4759,7 @@ igb_rxeof(struct igb_queue *que, int count, int *done) /* 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; diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index 882bd3ce1dbe..8c467f1b5697 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -3562,7 +3562,7 @@ lem_rxeof(struct adapter *adapter, int count, int *done) 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;