summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2014-11-10 16:35:07 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2014-11-10 16:35:07 +0000
commit8260f13047cf0ff3f9214fd044676fe1b54ad4ae (patch)
tree0cfb5857573fbe1283efd8d6ca4fcfc1c822fd95
parentb702d9a6e4732cb5e4cf1043cf65cbbe6fd430d8 (diff)
Gather full statistics only when IX_DEBUG is defined
since most of them can't be retrieved otherwise. This comes with a slight but measurable performance increase as well. Also since the hardware has a single counter for missed packets including those caused by the insufficient DMA buffers available, this makes it hard to decipher actual errors when used with Rx ring length limiting mechanisms like if_rxr or mclgeti.
-rw-r--r--sys/dev/pci/if_ix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index 3e92936aadd..bd184592c1b 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.102 2014/11/10 16:01:18 mikeb Exp $ */
+/* $OpenBSD: if_ix.c,v 1.103 2014/11/10 16:35:06 mikeb Exp $ */
/******************************************************************************
@@ -3260,12 +3260,16 @@ ixgbe_update_stats_counters(struct ix_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
struct ixgbe_hw *hw = &sc->hw;
- uint32_t missed_rx = 0, bprc, lxon, lxoff, total;
uint64_t total_missed_rx = 0;
+#ifdef IX_DEBUG
+ uint32_t missed_rx = 0, bprc, lxon, lxoff, total;
int i;
+#endif
sc->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
+ sc->stats.rlec += IXGBE_READ_REG(hw, IXGBE_RLEC);
+#ifdef IX_DEBUG
for (i = 0; i < 8; i++) {
uint32_t mp;
mp = IXGBE_READ_REG(hw, IXGBE_MPC(i));
@@ -3318,7 +3322,6 @@ ixgbe_update_stats_counters(struct ix_softc *sc)
sc->stats.prc511 += IXGBE_READ_REG(hw, IXGBE_PRC511);
sc->stats.prc1023 += IXGBE_READ_REG(hw, IXGBE_PRC1023);
sc->stats.prc1522 += IXGBE_READ_REG(hw, IXGBE_PRC1522);
- sc->stats.rlec += IXGBE_READ_REG(hw, IXGBE_RLEC);
lxon = IXGBE_READ_REG(hw, IXGBE_LXONTXC);
sc->stats.lxontxc += lxon;
@@ -3344,6 +3347,7 @@ ixgbe_update_stats_counters(struct ix_softc *sc)
sc->stats.ptc1023 += IXGBE_READ_REG(hw, IXGBE_PTC1023);
sc->stats.ptc1522 += IXGBE_READ_REG(hw, IXGBE_PTC1522);
sc->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
+#endif
#if 0
/* Fill out the OS statistics structure */