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 KNF a bit. No functional change.



details:   https://anonhg.NetBSD.org/src/rev/c2bec2de380c
branches:  trunk
changeset: 1020136:c2bec2de380c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Mar 31 07:53:53 2021 +0000

description:
KNF a bit. No functional change.

diffstat:

 sys/dev/pci/ixgbe/ix_txrx.c |  12 ++---
 sys/dev/pci/ixgbe/ixgbe.c   |  92 ++++++++++++++++++++++++--------------------
 sys/dev/pci/ixgbe/ixv.c     |  46 +++++++++++-----------
 3 files changed, 79 insertions(+), 71 deletions(-)

diffs (truncated from 346 to 300 lines):

diff -r 365f56800104 -r c2bec2de380c sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Wed Mar 31 07:52:14 2021 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Wed Mar 31 07:53:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.69 2021/03/12 01:54:29 knakahara Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.70 2021/03/31 07:53:53 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -202,7 +202,7 @@
 {
        struct adapter  *adapter = ifp->if_softc;
        struct tx_ring  *txr;
-       int             i;
+       int             i;
 #ifdef RSS
        uint32_t bucket_id;
 #endif
@@ -1755,11 +1755,9 @@
        rbuf = &rxr->rx_buffers[i];
 
        /*
-        * With advanced descriptors the writeback
-        * clobbers the buffer addrs, so its easier
-        * to just free the existing mbufs and take
-        * the normal refresh path to get new buffers
-        * and mapping.
+        * With advanced descriptors the writeback clobbers the buffer addrs,
+        * so its easier to just free the existing mbufs and take the normal
+        * refresh path to get new buffers and mapping.
         */
 
        if (rbuf->fmp != NULL) {/* Partial chain ? */
diff -r 365f56800104 -r c2bec2de380c sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Mar 31 07:52:14 2021 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Mar 31 07:53:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.279 2021/03/09 10:03:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.280 2021/03/31 07:53:53 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -1694,17 +1694,20 @@
                stats->gorc.ev_count += IXGBE_READ_REG(hw, IXGBE_GORCL) +
                    ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32);
                stats->gotc.ev_count += IXGBE_READ_REG(hw, IXGBE_GOTCL) +
-                   ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32) - total * ETHER_MIN_LEN;
+                   ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32)
+                   - total * ETHER_MIN_LEN;
                stats->tor.ev_count += IXGBE_READ_REG(hw, IXGBE_TORL) +
                    ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32);
                stats->lxonrxc.ev_count += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT);
-               stats->lxoffrxc.ev_count += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
+               stats->lxoffrxc.ev_count
+                   += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
        } else {
                stats->lxonrxc.ev_count += IXGBE_READ_REG(hw, IXGBE_LXONRXC);
                stats->lxoffrxc.ev_count += IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
                /* 82598 only has a counter in the high register */
                stats->gorc.ev_count += IXGBE_READ_REG(hw, IXGBE_GORCH);
-               stats->gotc.ev_count += IXGBE_READ_REG(hw, IXGBE_GOTCH) - total * ETHER_MIN_LEN;
+               stats->gotc.ev_count += IXGBE_READ_REG(hw, IXGBE_GOTCH)
+                   - total * ETHER_MIN_LEN;
                stats->tor.ev_count += IXGBE_READ_REG(hw, IXGBE_TORH);
        }
 
@@ -1916,42 +1919,35 @@
 #endif
 
                if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY,
-                   CTLTYPE_INT,
-                   "rxd_nxck", SYSCTL_DESCR("Receive Descriptor next to check"),
-                       ixgbe_sysctl_next_to_check_handler, 0, (void *)rxr, 0,
+                   CTLFLAG_READONLY, CTLTYPE_INT, "rxd_nxck",
+                   SYSCTL_DESCR("Receive Descriptor next to check"),
+                   ixgbe_sysctl_next_to_check_handler, 0, (void *)rxr, 0,
                    CTL_CREATE, CTL_EOL) != 0)
                        break;
 
                if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY,
-                   CTLTYPE_INT,
-                   "rxd_head", SYSCTL_DESCR("Receive Descriptor Head"),
+                   CTLFLAG_READONLY, CTLTYPE_INT, "rxd_head",
+                   SYSCTL_DESCR("Receive Descriptor Head"),
                    ixgbe_sysctl_rdh_handler, 0, (void *)rxr, 0,
                    CTL_CREATE, CTL_EOL) != 0)
                        break;
 
                if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY,
-                   CTLTYPE_INT,
-                   "rxd_tail", SYSCTL_DESCR("Receive Descriptor Tail"),
+                   CTLFLAG_READONLY, CTLTYPE_INT, "rxd_tail",
+                   SYSCTL_DESCR("Receive Descriptor Tail"),
                    ixgbe_sysctl_rdt_handler, 0, (void *)rxr, 0,
                    CTL_CREATE, CTL_EOL) != 0)
                        break;
 
                if (i < __arraycount(stats->qprc)) {
-                       evcnt_attach_dynamic(&stats->qprc[i],
-                           EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
-                           "qprc");
-                       evcnt_attach_dynamic(&stats->qptc[i],
-                           EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
-                           "qptc");
-                       evcnt_attach_dynamic(&stats->qbrc[i],
-                           EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
-                           "qbrc");
-                       evcnt_attach_dynamic(&stats->qbtc[i],
-                           EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
-                           "qbtc");
+                       evcnt_attach_dynamic(&stats->qprc[i], EVCNT_TYPE_MISC,
+                           NULL, adapter->queues[i].evnamebuf, "qprc");
+                       evcnt_attach_dynamic(&stats->qptc[i], EVCNT_TYPE_MISC,
+                           NULL, adapter->queues[i].evnamebuf, "qptc");
+                       evcnt_attach_dynamic(&stats->qbrc[i], EVCNT_TYPE_MISC,
+                           NULL, adapter->queues[i].evnamebuf, "qbrc");
+                       evcnt_attach_dynamic(&stats->qbtc[i], EVCNT_TYPE_MISC,
+                           NULL, adapter->queues[i].evnamebuf, "qbtc");
                        if (hw->mac.type >= ixgbe_mac_82599EB)
                                evcnt_attach_dynamic(&stats->qprdc[i],
                                    EVCNT_TYPE_MISC, NULL,
@@ -1959,9 +1955,11 @@
                }
 
                evcnt_attach_dynamic(&rxr->rx_packets, EVCNT_TYPE_MISC,
-                   NULL, adapter->queues[i].evnamebuf, "Queue Packets Received");
+                   NULL, adapter->queues[i].evnamebuf,
+                   "Queue Packets Received");
                evcnt_attach_dynamic(&rxr->rx_bytes, EVCNT_TYPE_MISC,
-                   NULL, adapter->queues[i].evnamebuf, "Queue Bytes Received");
+                   NULL, adapter->queues[i].evnamebuf,
+                   "Queue Bytes Received");
                evcnt_attach_dynamic(&rxr->rx_copies, EVCNT_TYPE_MISC,
                    NULL, adapter->queues[i].evnamebuf, "Copied RX Frames");
                evcnt_attach_dynamic(&rxr->no_jmbuf, EVCNT_TYPE_MISC,
@@ -3193,8 +3191,11 @@
                                retval = hw->phy.ops.check_overtemp(hw);
                                if (retval != IXGBE_ERR_OVERTEMP)
                                        break;
-                               device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
-                               device_printf(adapter->dev, "System shutdown required!\n");
+                               device_printf(adapter->dev,
+                                   "CRITICAL: OVER TEMP!! "
+                                   "PHY IS SHUT DOWN!!\n");
+                               device_printf(adapter->dev,
+                                   "System shutdown required!\n");
                                break;
                        default:
                                if (!(eicr & IXGBE_EICR_TS))
@@ -3205,8 +3206,11 @@
                                retval = hw->phy.ops.check_overtemp(hw);
                                if (retval != IXGBE_ERR_OVERTEMP)
                                        break;
-                               device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
-                               device_printf(adapter->dev, "System shutdown required!\n");
+                               device_printf(adapter->dev,
+                                   "CRITICAL: OVER TEMP!! "
+                                   "PHY IS SHUT DOWN!!\n");
+                               device_printf(adapter->dev,
+                                   "System shutdown required!\n");
                                break;
                        }
                }
@@ -3359,7 +3363,8 @@
        if (sysctl_createv(log, 0, &rnode, &cnode,
            CTLFLAG_READWRITE, CTLTYPE_INT,
            "debug", SYSCTL_DESCR("Debug Info"),
-           ixgbe_sysctl_debug, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
+           ixgbe_sysctl_debug, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL)
+           != 0)
                aprint_error_dev(dev, "could not create sysctl\n");
 
        if (sysctl_createv(log, 0, &rnode, &cnode,
@@ -3413,8 +3418,10 @@
         */
        adapter->txrx_use_workqueue = ixgbe_txrx_workqueue;
        if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READWRITE,
-           CTLTYPE_BOOL, "txrx_workqueue", SYSCTL_DESCR("Use workqueue for packet processing"),
-           NULL, 0, &adapter->txrx_use_workqueue, 0, CTL_CREATE, CTL_EOL) != 0)
+           CTLTYPE_BOOL, "txrx_workqueue",
+           SYSCTL_DESCR("Use workqueue for packet processing"),
+           NULL, 0, &adapter->txrx_use_workqueue, 0, CTL_CREATE,
+           CTL_EOL) != 0)
                aprint_error_dev(dev, "could not create sysctl\n");
 
 #ifdef IXGBE_DEBUG
@@ -3477,7 +3484,8 @@
 
                if (sysctl_createv(log, 0, &phy_node, &cnode, CTLFLAG_READONLY,
                    CTLTYPE_INT, "overtemp_occurred",
-                   SYSCTL_DESCR("External PHY High Temperature Event Occurred"),
+                   SYSCTL_DESCR(
+                           "External PHY High Temperature Event Occurred"),
                    ixgbe_sysctl_phy_overtemp_occurred, 0, (void *)adapter, 0,
                    CTL_CREATE, CTL_EOL) != 0)
                        aprint_error_dev(dev, "could not create sysctl\n");
@@ -5537,8 +5545,7 @@
        }
 
        if (advertise < 0x0 || advertise > 0x3f) {
-               device_printf(dev,
-                   "Invalid advertised speed; valid modes are 0x0 through 0x3f\n");
+               device_printf(dev, "Invalid advertised speed; valid modes are 0x0 through 0x3f\n");
                return (EINVAL);
        }
 
@@ -6525,7 +6532,8 @@
            IXGBE_ESDP_SDP1;
 
        if (reg & mask) {
-               device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n");
+               device_printf(adapter->dev,
+                   "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n");
                return IXGBE_ERR_FAN_FAILURE;
        }
 
@@ -6672,7 +6680,8 @@
                    softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
                        ixgbe_deferred_mq_start, txr);
 
-               snprintf(wqname, sizeof(wqname), "%sdeferTx", device_xname(dev));
+               snprintf(wqname, sizeof(wqname), "%sdeferTx",
+                   device_xname(dev));
                defertx_error = workqueue_create(&adapter->txr_wq, wqname,
                    ixgbe_deferred_mq_start_work, adapter, IXGBE_WORKQUEUE_PRI,
                    IPL_NET, IXGBE_WORKQUEUE_FLAGS);
@@ -6842,7 +6851,8 @@
            ixgbe_deferred_mq_start_work, adapter, IXGBE_WORKQUEUE_PRI, IPL_NET,
            IXGBE_WORKQUEUE_FLAGS);
        if (error) {
-               aprint_error_dev(dev, "couldn't create workqueue for deferred Tx\n");
+               aprint_error_dev(dev,
+                   "couldn't create workqueue for deferred Tx\n");
                goto err_out;
        }
        adapter->txr_wq_enqueued = percpu_alloc(sizeof(u_int));
diff -r 365f56800104 -r c2bec2de380c sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Wed Mar 31 07:52:14 2021 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Wed Mar 31 07:53:53 2021 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.157 2021/03/31 07:52:14 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.158 2021/03/31 07:53:53 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -2555,8 +2555,8 @@
        }
 
        if (sysctl_createv(log, 0, &rnode, &cnode,
-           CTLFLAG_READWRITE, CTLTYPE_INT,
-           "debug", SYSCTL_DESCR("Debug Info"),
+           CTLFLAG_READWRITE, CTLTYPE_INT, "debug",
+           SYSCTL_DESCR("Debug Info"),
            ixv_sysctl_debug, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
                aprint_error_dev(dev, "could not create sysctl\n");
 
@@ -2568,15 +2568,16 @@
                aprint_error_dev(dev, "could not create sysctl\n");
 
        if (sysctl_createv(log, 0, &rnode, &cnode,
-           CTLFLAG_READWRITE, CTLTYPE_BOOL,
-           "enable_aim", SYSCTL_DESCR("Interrupt Moderation"),
+           CTLFLAG_READWRITE, CTLTYPE_BOOL, "enable_aim",
+           SYSCTL_DESCR("Interrupt Moderation"),
            NULL, 0, &adapter->enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
                aprint_error_dev(dev, "could not create sysctl\n");
 
        if (sysctl_createv(log, 0, &rnode, &cnode,
-           CTLFLAG_READWRITE, CTLTYPE_BOOL,
-           "txrx_workqueue", SYSCTL_DESCR("Use workqueue for packet processing"),
-               NULL, 0, &adapter->txrx_use_workqueue, 0, CTL_CREATE, CTL_EOL) != 0)
+           CTLFLAG_READWRITE, CTLTYPE_BOOL, "txrx_workqueue",
+           SYSCTL_DESCR("Use workqueue for packet processing"),
+           NULL, 0, &adapter->txrx_use_workqueue, 0, CTL_CREATE, CTL_EOL)
+           != 0)
                aprint_error_dev(dev, "could not create sysctl\n");
 }
 
@@ -2684,33 +2685,32 @@
 #endif /* LRO */
 
                if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY,
-                   CTLTYPE_INT,
-                   "rxd_nxck", SYSCTL_DESCR("Receive Descriptor next to check"),
-                       ixv_sysctl_next_to_check_handler, 0, (void *)rxr, 0,
+                   CTLFLAG_READONLY, CTLTYPE_INT, "rxd_nxck",
+                   SYSCTL_DESCR("Receive Descriptor next to check"),
+                   ixv_sysctl_next_to_check_handler, 0, (void *)rxr, 0,
                    CTL_CREATE, CTL_EOL) != 0)
                        break;
 
                if (sysctl_createv(log, 0, &rnode, &cnode,
-                   CTLFLAG_READONLY,
-                   CTLTYPE_INT,
-                   "rxd_head", SYSCTL_DESCR("Receive Descriptor Head"),
+                   CTLFLAG_READONLY, CTLTYPE_INT, "rxd_head",



Home | Main Index | Thread Index | Old Index