Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe - Make "Handled queue in softint" and "Req...



details:   https://anonhg.NetBSD.org/src/rev/bb37f10bef6c
branches:  trunk
changeset: 321224:bb37f10bef6c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Mar 07 03:29:10 2018 +0000

description:
- Make "Handled queue in softint" and "Requeued in softint" evcnt(9) per queue
  and count them correctly.
- Remove #if 0'ed code.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  37 ++++++++++++++++---------------------
 sys/dev/pci/ixgbe/ixgbe.h |   6 +++---
 sys/dev/pci/ixgbe/ixv.c   |  33 +++++++++++++--------------------
 3 files changed, 32 insertions(+), 44 deletions(-)

diffs (246 lines):

diff -r 11ed515ba22b -r bb37f10bef6c sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Mar 07 02:30:37 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Mar 07 03:29:10 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.128 2018/03/02 10:19:20 knakahara Exp $ */
+/* $NetBSD: ixgbe.c,v 1.129 2018/03/07 03:29:10 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -1686,10 +1686,6 @@
        const char *xname = device_xname(dev);
 
        /* Driver Statistics */
-       evcnt_attach_dynamic(&adapter->handleq, EVCNT_TYPE_MISC,
-           NULL, xname, "Handled queue in softint");
-       evcnt_attach_dynamic(&adapter->req, EVCNT_TYPE_MISC,
-           NULL, xname, "Requeued in softint");
        evcnt_attach_dynamic(&adapter->efbig_tx_dma_setup, EVCNT_TYPE_MISC,
            NULL, xname, "Driver tx dma soft fail EFBIG");
        evcnt_attach_dynamic(&adapter->mbuf_defrag_failed, EVCNT_TYPE_MISC,
@@ -1736,15 +1732,6 @@
                    (void *)&adapter->queues[i], 0, CTL_CREATE, CTL_EOL) != 0)
                        break;
 
-#if 0 /* XXX msaitoh */
-               if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY, CTLTYPE_QUAD,
-                   "irqs", SYSCTL_DESCR("irqs on this queue"),
-                       NULL, 0, &(adapter->queues[i].irqs),
-                   0, CTL_CREATE, CTL_EOL) != 0)
-                       break;
-#endif
-
                if (sysctl_createv(log, 0, &rnode, &cnode,
                    CTLFLAG_READONLY, CTLTYPE_INT,
                    "txd_head", SYSCTL_DESCR("Transmit Descriptor Head"),
@@ -1761,6 +1748,11 @@
 
                evcnt_attach_dynamic(&adapter->queues[i].irqs, EVCNT_TYPE_INTR,
                    NULL, adapter->queues[i].evnamebuf, "IRQs on queue");
+               evcnt_attach_dynamic(&adapter->queues[i].handleq,
+                   EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
+                   "Handled queue in softint");
+               evcnt_attach_dynamic(&adapter->queues[i].req, EVCNT_TYPE_MISC,
+                   NULL, adapter->queues[i].evnamebuf, "Requeued in softint");
                evcnt_attach_dynamic(&txr->tso_tx, EVCNT_TYPE_MISC,
                    NULL, adapter->queues[i].evnamebuf, "TSO");
                evcnt_attach_dynamic(&txr->no_desc_avail, EVCNT_TYPE_MISC,
@@ -1981,8 +1973,6 @@
        struct ixgbe_hw *hw = &adapter->hw;
        struct ixgbe_hw_stats *stats = &adapter->stats.pf;
 
-       adapter->handleq.ev_count = 0;
-       adapter->req.ev_count = 0;
        adapter->efbig_tx_dma_setup.ev_count = 0;
        adapter->mbuf_defrag_failed.ev_count = 0;
        adapter->efbig2_tx_dma_setup.ev_count = 0;
@@ -1997,6 +1987,8 @@
        txr = adapter->tx_rings;
        for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
                adapter->queues[i].irqs.ev_count = 0;
+               adapter->queues[i].handleq.ev_count = 0;
+               adapter->queues[i].req.ev_count = 0;
                txr->no_desc_avail.ev_count = 0;
                txr->total_packets.ev_count = 0;
                txr->tso_tx.ev_count = 0;
@@ -2535,6 +2527,7 @@
 
 no_calc:
        if (more) {
+               que->req.ev_count++;
                if (adapter->txrx_use_workqueue) {
                        /*
                         * adapter->que_wq is bound to each CPU instead of
@@ -3376,8 +3369,6 @@
        if_percpuq_destroy(adapter->ipq);
 
        sysctl_teardown(&adapter->sysctllog);
-       evcnt_detach(&adapter->handleq);
-       evcnt_detach(&adapter->req);
        evcnt_detach(&adapter->efbig_tx_dma_setup);
        evcnt_detach(&adapter->mbuf_defrag_failed);
        evcnt_detach(&adapter->efbig2_tx_dma_setup);
@@ -3392,6 +3383,8 @@
        txr = adapter->tx_rings;
        for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
                evcnt_detach(&adapter->queues[i].irqs);
+               evcnt_detach(&adapter->queues[i].handleq);
+               evcnt_detach(&adapter->queues[i].req);
                evcnt_detach(&txr->no_desc_avail);
                evcnt_detach(&txr->total_packets);
                evcnt_detach(&txr->tso_tx);
@@ -4724,9 +4717,10 @@
            (eicr & IXGBE_EICR_GPI_SDP0_X540))
                softint_schedule(adapter->phy_si);
 
-       if (more)
+       if (more) {
+               que->req.ev_count++;
                softint_schedule(que->que_si);
-       else
+       } else
                ixgbe_enable_intr(adapter);
 
        return 1;
@@ -5825,7 +5819,7 @@
        struct ifnet    *ifp = adapter->ifp;
        bool            more = false;
 
-       adapter->handleq.ev_count++;
+       que->handleq.ev_count++;
 
        if (ifp->if_flags & IFF_RUNNING) {
                more = ixgbe_rxeof(que);
@@ -5843,6 +5837,7 @@
        }
 
        if (more) {
+               que->req.ev_count++;
                if (adapter->txrx_use_workqueue) {
                        /*
                         * "enqueued flag" is not required here.
diff -r 11ed515ba22b -r bb37f10bef6c sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Wed Mar 07 02:30:37 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Wed Mar 07 03:29:10 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.33 2018/03/06 03:47:23 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.34 2018/03/07 03:29:10 msaitoh Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -335,6 +335,8 @@
        struct work      wq_cookie;
        void             *que_si;
        struct evcnt     irqs;
+       struct evcnt     handleq;
+       struct evcnt     req;
        char             namebuf[32];
        char             evnamebuf[32];
 
@@ -566,8 +568,6 @@
        struct evcnt            tso_err;
        struct evcnt            watchdog_events;
        struct evcnt            link_irq;
-       struct evcnt            handleq;
-       struct evcnt            req;
 
        union {
                struct ixgbe_hw_stats pf;
diff -r 11ed515ba22b -r bb37f10bef6c sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Wed Mar 07 02:30:37 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Wed Mar 07 03:29:10 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.84 2018/03/02 10:21:01 knakahara Exp $*/
+/*$NetBSD: ixv.c,v 1.85 2018/03/07 03:29:10 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -640,8 +640,6 @@
        if_percpuq_destroy(adapter->ipq);
 
        sysctl_teardown(&adapter->sysctllog);
-       evcnt_detach(&adapter->handleq);
-       evcnt_detach(&adapter->req);
        evcnt_detach(&adapter->efbig_tx_dma_setup);
        evcnt_detach(&adapter->mbuf_defrag_failed);
        evcnt_detach(&adapter->efbig2_tx_dma_setup);
@@ -656,6 +654,8 @@
        txr = adapter->tx_rings;
        for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
                evcnt_detach(&adapter->queues[i].irqs);
+               evcnt_detach(&adapter->queues[i].handleq);
+               evcnt_detach(&adapter->queues[i].req);
                evcnt_detach(&txr->no_desc_avail);
                evcnt_detach(&txr->total_packets);
                evcnt_detach(&txr->tso_tx);
@@ -959,9 +959,10 @@
        rxr->packets = 0;
 
 no_calc:
-       if (more)
+       if (more) {
+               que->req.ev_count++;
                softint_schedule(que->que_si);
-       else /* Re-enable this interrupt */
+       } else /* Re-enable this interrupt */
                ixv_enable_queue(adapter, que->msix);
 
        return 1;
@@ -2341,10 +2342,6 @@
        const char *xname = device_xname(dev);
 
        /* Driver Statistics */
-       evcnt_attach_dynamic(&adapter->handleq, EVCNT_TYPE_MISC,
-           NULL, xname, "Handled queue in softint");
-       evcnt_attach_dynamic(&adapter->req, EVCNT_TYPE_MISC,
-           NULL, xname, "Requeued in softint");
        evcnt_attach_dynamic(&adapter->efbig_tx_dma_setup, EVCNT_TYPE_MISC,
            NULL, xname, "Driver tx dma soft fail EFBIG");
        evcnt_attach_dynamic(&adapter->mbuf_defrag_failed, EVCNT_TYPE_MISC,
@@ -2391,15 +2388,6 @@
                    (void *)&adapter->queues[i], 0, CTL_CREATE, CTL_EOL) != 0)
                        break;
 
-#if 0
-               if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY, CTLTYPE_QUAD,
-                   "irqs", SYSCTL_DESCR("irqs on this queue"),
-                       NULL, 0, &(adapter->queues[i].irqs),
-                   0, CTL_CREATE, CTL_EOL) != 0)
-                       break;
-#endif
-
                if (sysctl_createv(log, 0, &rnode, &cnode,
                    CTLFLAG_READONLY, CTLTYPE_INT,
                    "txd_head", SYSCTL_DESCR("Transmit Descriptor Head"),
@@ -2416,6 +2404,11 @@
 
                evcnt_attach_dynamic(&adapter->queues[i].irqs, EVCNT_TYPE_INTR,
                    NULL, adapter->queues[i].evnamebuf, "IRQs on queue");
+               evcnt_attach_dynamic(&adapter->queues[i].handleq,
+                   EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
+                   "Handled queue in softint");
+               evcnt_attach_dynamic(&adapter->queues[i].req, EVCNT_TYPE_MISC,
+                   NULL, adapter->queues[i].evnamebuf, "Requeued in softint");
                evcnt_attach_dynamic(&txr->tso_tx, EVCNT_TYPE_MISC,
                    NULL, adapter->queues[i].evnamebuf, "TSO");
                evcnt_attach_dynamic(&txr->no_desc_avail, EVCNT_TYPE_MISC,
@@ -2804,7 +2797,7 @@
        struct ifnet    *ifp = adapter->ifp;
        bool            more;
 
-       adapter->handleq.ev_count++;
+       que->handleq.ev_count++;
 
        if (ifp->if_flags & IFF_RUNNING) {
                more = ixgbe_rxeof(que);
@@ -2820,7 +2813,7 @@
                        ixgbe_legacy_start_locked(ifp, txr);
                IXGBE_TX_UNLOCK(txr);
                if (more) {
-                       adapter->req.ev_count++;
+                       que->req.ev_count++;
                        if (adapter->txrx_use_workqueue) {
                                /*
                                 * "enqueued flag" is not required here



Home | Main Index | Thread Index | Old Index