jme: Record number of times that RX ring becomes empty
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 29 Aug 2012 09:35:08 +0000 (17:35 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 29 Aug 2012 09:35:08 +0000 (17:35 +0800)
sys/dev/netif/jme/if_jme.c
sys/dev/netif/jme/if_jmevar.h

index c89b352..b380b79 100644 (file)
@@ -1073,13 +1073,22 @@ jme_sysctl_node(struct jme_softc *sc)
                       "rss_debug", CTLFLAG_RW, &sc->jme_rss_debug,
                       0, "RSS debug level");
        for (r = 0; r < sc->jme_cdata.jme_rx_ring_cnt; ++r) {
-               char rx_ring_pkt[32];
+               char rx_ring_desc[32];
 
-               ksnprintf(rx_ring_pkt, sizeof(rx_ring_pkt), "rx_ring%d_pkt", r);
+               ksnprintf(rx_ring_desc, sizeof(rx_ring_desc),
+                   "rx_ring%d_pkt", r);
                SYSCTL_ADD_ULONG(&sc->jme_sysctl_ctx,
                    SYSCTL_CHILDREN(sc->jme_sysctl_tree), OID_AUTO,
-                   rx_ring_pkt, CTLFLAG_RW,
+                   rx_ring_desc, CTLFLAG_RW,
                    &sc->jme_cdata.jme_rx_data[r].jme_rx_pkt, "RXed packets");
+
+               ksnprintf(rx_ring_desc, sizeof(rx_ring_desc),
+                   "rx_ring%d_emp", r);
+               SYSCTL_ADD_ULONG(&sc->jme_sysctl_ctx,
+                   SYSCTL_CHILDREN(sc->jme_sysctl_tree), OID_AUTO,
+                   rx_ring_desc, CTLFLAG_RW,
+                   &sc->jme_cdata.jme_rx_data[r].jme_rx_emp,
+                   "# of time RX ring empty");
        }
 #endif
 
@@ -3723,6 +3732,7 @@ jme_msix_rx(void *xrdata)
                if (status & rdata->jme_rx_empty) {
                        CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr |
                            RXCSR_RX_ENB | RXCSR_RXQ_START);
+                       rdata->jme_rx_emp++;
                }
        }
 
index c38b4ef..b023950 100644 (file)
@@ -162,6 +162,7 @@ struct jme_rxdata {
        struct mbuf             *jme_rxtail;
 
        u_long                  jme_rx_pkt;
+       u_long                  jme_rx_emp;
 } __cachealign;
 
 struct jme_chain_data {