igb: Add per-TX ring tx_pkt sysctl node, if IGB_TSS_DEBUG is enabled
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 11:51:23 +0000 (19:51 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 11:51:23 +0000 (19:51 +0800)
sys/dev/netif/igb/if_igb.c
sys/dev/netif/igb/if_igb.h

index 03d1c60..b021d07 100644 (file)
@@ -1596,6 +1596,14 @@ igb_add_sysctl(struct igb_softc *sc)
                    CTLFLAG_RW, &sc->rx_rings[i].rx_packets, "RXed packets");
        }
 #endif
+#ifdef IGB_TSS_DEBUG
+       for  (i = 0; i < sc->tx_ring_cnt; ++i) {
+               ksnprintf(node, sizeof(node), "tx%d_pkt", i);
+               SYSCTL_ADD_ULONG(&sc->sysctl_ctx,
+                   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, node,
+                   CTLFLAG_RW, &sc->tx_rings[i].tx_packets, "TXed packets");
+       }
+#endif
 }
 
 static int
@@ -3354,7 +3362,9 @@ igb_encap(struct igb_tx_ring *txr, struct mbuf **m_headp,
         * Defer TDT updating, until enough descrptors are setup
         */
        *idx = i;
+#ifdef IGB_TSS_DEBUG
        ++txr->tx_packets;
+#endif
 
        return 0;
 }
index b0a5984..85f6287 100644 (file)
@@ -248,7 +248,6 @@ struct igb_tx_ring {
        struct ifsubq_watchdog  tx_watchdog;
 
        /* Soft stats */
-       u_long                  no_desc_avail;
        u_long                  tx_packets;
 
        struct igb_dma          txdma;