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



details:   https://anonhg.NetBSD.org/src/rev/7ed4ed374fd2
branches:  trunk
changeset: 366612:7ed4ed374fd2
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Jun 02 01:57:27 2022 +0000

description:
KNF. No functional change.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  144 ++++++++++++++++++++++-----------------------
 sys/dev/pci/ixgbe/ixv.c   |   29 ++++----
 2 files changed, 86 insertions(+), 87 deletions(-)

diffs (truncated from 450 to 300 lines):

diff -r d2cb8bd77c71 -r 7ed4ed374fd2 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Jun 02 00:32:14 2022 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Jun 02 01:57:27 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.318 2022/06/01 05:06:45 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.319 2022/06/02 01:57:27 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.318 2022/06/01 05:06:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.319 2022/06/02 01:57:27 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -629,12 +629,11 @@
                 * so we do not need to clear the bit, but do it just in case
                 * this code is moved elsewhere.
                 */
-               if (adapter->num_queues > 1 &&
-                   adapter->hw.fc.requested_mode == ixgbe_fc_none) {
+               if ((adapter->num_queues > 1) &&
+                   (adapter->hw.fc.requested_mode == ixgbe_fc_none))
                        srrctl |= IXGBE_SRRCTL_DROP_EN;
-               } else {
+               else
                        srrctl &= ~IXGBE_SRRCTL_DROP_EN;
-               }
 
                IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl);
 
@@ -893,7 +892,8 @@
         * Initialize the shared code
         */
        if (ixgbe_init_shared_code(hw) != 0) {
-               aprint_error_dev(dev, "Unable to initialize the shared code\n");
+               aprint_error_dev(dev,
+                   "Unable to initialize the shared code\n");
                error = ENXIO;
                goto err_out;
        }
@@ -1178,7 +1178,8 @@
        error = ixgbe_start_hw(hw);
        switch (error) {
        case IXGBE_ERR_EEPROM_VERSION:
-               aprint_error_dev(dev, "This device is a pre-production adapter/"
+               aprint_error_dev(dev,
+                   "This device is a pre-production adapter/"
                    "LOM.  Please be aware there may be issues associated "
                    "with your hardware.\nIf you are experiencing problems "
                    "please contact your Intel or hardware representative "
@@ -1470,60 +1471,45 @@
        ADD(IFM_NONE, 0);
 
        /* Media types with matching NetBSD media defines */
-       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) {
+       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T)
                ADD(IFM_10G_T | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T) {
+       if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T)
                ADD(IFM_1000_T | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_100BASE_TX) {
+       if (layer & IXGBE_PHYSICAL_LAYER_100BASE_TX)
                ADD(IFM_100_TX | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_10BASE_T) {
+       if (layer & IXGBE_PHYSICAL_LAYER_10BASE_T)
                ADD(IFM_10_T | IFM_FDX, 0);
-       }
 
        if (layer & IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU ||
-           layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) {
+           layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA)
                ADD(IFM_10G_TWINAX | IFM_FDX, 0);
-       }
 
        if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) {
                ADD(IFM_10G_LR | IFM_FDX, 0);
-               if (hw->phy.multispeed_fiber) {
+               if (hw->phy.multispeed_fiber)
                        ADD(IFM_1000_LX | IFM_FDX, 0);
-               }
        }
        if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) {
                ADD(IFM_10G_SR | IFM_FDX, 0);
-               if (hw->phy.multispeed_fiber) {
+               if (hw->phy.multispeed_fiber)
                        ADD(IFM_1000_SX | IFM_FDX, 0);
-               }
-       } else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) {
+       } else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX)
                ADD(IFM_1000_SX | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4) {
+       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4)
                ADD(IFM_10G_CX4 | IFM_FDX, 0);
-       }
-
-       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) {
+
+       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR)
                ADD(IFM_10G_KR | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) {
+       if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4)
                ADD(IFM_10G_KX4 | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) {
+       if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX)
                ADD(IFM_1000_KX | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_2500BASE_KX) {
+       if (layer & IXGBE_PHYSICAL_LAYER_2500BASE_KX)
                ADD(IFM_2500_KX | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_2500BASE_T) {
+       if (layer & IXGBE_PHYSICAL_LAYER_2500BASE_T)
                ADD(IFM_2500_T | IFM_FDX, 0);
-       }
-       if (layer & IXGBE_PHYSICAL_LAYER_5GBASE_T) {
+       if (layer & IXGBE_PHYSICAL_LAYER_5GBASE_T)
                ADD(IFM_5000_T | IFM_FDX, 0);
-       }
        if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
                ADD(IFM_1000_BX10 | IFM_FDX, 0);
        /* XXX no ifmedia_set? */
@@ -1673,13 +1659,17 @@
                IXGBE_EVC_REGADD(hw, stats, IXGBE_PXONTXC(i), pxontxc[i]);
                IXGBE_EVC_REGADD(hw, stats, IXGBE_PXOFFTXC(i), pxofftxc[i]);
                if (hw->mac.type >= ixgbe_mac_82599EB) {
-                       IXGBE_EVC_REGADD(hw, stats, IXGBE_PXONRXCNT(i), pxonrxc[i]);
-                       IXGBE_EVC_REGADD(hw, stats, IXGBE_PXOFFRXCNT(i), pxoffrxc[i]);
-                       IXGBE_EVC_REGADD(hw, stats, IXGBE_PXON2OFFCNT(i),
-                           pxon2offc[i]);
+                       IXGBE_EVC_REGADD(hw, stats,
+                           IXGBE_PXONRXCNT(i), pxonrxc[i]);
+                       IXGBE_EVC_REGADD(hw, stats,
+                           IXGBE_PXOFFRXCNT(i), pxoffrxc[i]);
+                       IXGBE_EVC_REGADD(hw, stats,
+                           IXGBE_PXON2OFFCNT(i), pxon2offc[i]);
                } else {
-                       IXGBE_EVC_REGADD(hw, stats, IXGBE_PXONRXC(i), pxonrxc[i]);
-                       IXGBE_EVC_REGADD(hw, stats, IXGBE_PXOFFRXC(i), pxoffrxc[i]);
+                       IXGBE_EVC_REGADD(hw, stats,
+                           IXGBE_PXONRXC(i), pxonrxc[i]);
+                       IXGBE_EVC_REGADD(hw, stats,
+                           IXGBE_PXOFFRXC(i), pxoffrxc[i]);
                }
        }
        IXGBE_EVC_ADD(&stats->mpctotal, total_missed_rx);
@@ -1843,8 +1833,7 @@
        KASSERT(IXGBE_DCB_MAX_TRAFFIC_CLASS == 8);
        for (i = 0; i < IXGBE_TC_COUNTER_NUM; i++) {
                snprintf(adapter->tcs[i].evnamebuf,
-                   sizeof(adapter->tcs[i].evnamebuf), "%s tc%d",
-                   xname, i);
+                   sizeof(adapter->tcs[i].evnamebuf), "%s tc%d", xname, i);
                if (i < __arraycount(stats->mpc)) {
                        evcnt_attach_dynamic(&stats->mpc[i],
                            EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
@@ -1872,7 +1861,7 @@
                                evcnt_attach_dynamic(&stats->pxon2offc[i],
                                    EVCNT_TYPE_MISC, NULL,
                                    adapter->tcs[i].evnamebuf,
-                           "pxon2offc");
+                                   "pxon2offc");
                }
        }
 
@@ -1882,13 +1871,13 @@
 #endif /* LRO */
 
                snprintf(adapter->queues[i].evnamebuf,
-                   sizeof(adapter->queues[i].evnamebuf), "%s q%d",
-                   xname, i);
+                   sizeof(adapter->queues[i].evnamebuf), "%s q%d", xname, i);
                snprintf(adapter->queues[i].namebuf,
                    sizeof(adapter->queues[i].namebuf), "q%d", i);
 
                if ((rnode = ixgbe_sysctl_instance(adapter)) == NULL) {
-                       aprint_error_dev(dev, "could not create sysctl root\n");
+                       aprint_error_dev(dev,
+                           "could not create sysctl root\n");
                        break;
                }
 
@@ -2678,7 +2667,9 @@
                            "PCIE Gen3 slot is required.\n");
                }
        } else
-               device_printf(dev, "Unable to determine slot speed/width. The speed/width reported are that of the internal switch.\n");
+               device_printf(dev,
+                   "Unable to determine slot speed/width. The speed/width "
+                   "reported are that of the internal switch.\n");
 
        return;
 } /* ixgbe_get_slot_info */
@@ -2783,9 +2774,8 @@
                 * twice workqueue_enqueue() is not required .
                 */
                workqueue_enqueue(adapter->que_wq, &que->wq_cookie, curcpu());
-       } else {
+       } else
                softint_schedule(que->que_si);
-       }
 }
 
 /************************************************************************
@@ -2859,10 +2849,9 @@
         * on 1G and higher.
         */
        if ((adapter->link_speed != IXGBE_LINK_SPEED_100_FULL)
-           && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL)) {
+           && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL))
                if (newitr < IXGBE_MIN_RSC_EITR_10G1G)
                        newitr = IXGBE_MIN_RSC_EITR_10G1G;
-       }
 
        /* save for next interrupt */
        que->eitr_setting = newitr;
@@ -3287,7 +3276,6 @@
                ixgbe_schedule_admin_tasklet(adapter);
                mutex_exit(&adapter->admin_mtx);
        }
-
 }
 
 static void
@@ -3918,7 +3906,6 @@
                /* Enable wakeups and power management in Wakeup Control */
                IXGBE_WRITE_REG(hw, IXGBE_WUC,
                    IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN);
-
        }
 
        IXGBE_CORE_UNLOCK(adapter);
@@ -4744,7 +4731,11 @@
        if (ixgbe_fw_recovery_mode(hw)) {
                if (atomic_cas_uint(&adapter->recovery_mode, 0, 1) == 0) {
                        /* Firmware error detected, entering recovery mode */
-                       device_printf(adapter->dev, "Firmware recovery mode detected. Limiting functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware 
recovery mode.\n");
+                       device_printf(adapter->dev,
+                           "Firmware recovery mode detected. Limiting "
+                           "functionality. Refer to the Intel(R) Ethernet "
+                           "Adapters and Devices User Guide for details on "
+                           "firmware recovery mode.\n");
 
                        if (hw->adapter_stopped == FALSE)
                                ixgbe_stop_locked(adapter);
@@ -4923,9 +4914,8 @@
                ixgbe_handle_link(adapter);
                eims_enable |= IXGBE_EIMS_LSC;
        }
-       if ((task_requests & IXGBE_REQUEST_TASK_MOD_WOI) != 0) {
+       if ((task_requests & IXGBE_REQUEST_TASK_MOD_WOI) != 0)
                ixgbe_handle_mod(adapter, false);
-       }
        if ((task_requests & IXGBE_REQUEST_TASK_MOD) != 0) {
                ixgbe_handle_mod(adapter, true);
                if (hw->mac.type >= ixgbe_mac_X540)
@@ -5318,7 +5308,6 @@
                ixgbe_sched_handle_que(adapter, que);
                /* Disable queue 0 interrupt */
                eims_disable |= 1UL << 0;
-
        } else
                eims_enable |= eims_orig & IXGBE_EIMC_RTX_QUEUE;
 
@@ -5574,7 +5563,8 @@
        }
 
        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);
        }
 
@@ -5582,7 +5572,8 @@
                err = hw->mac.ops.get_link_capabilities(hw, &link_caps,
                    &negotiate);
                if (err != IXGBE_SUCCESS) {
-                       device_printf(dev, "Unable to determine supported advertise speeds\n");
+                       device_printf(dev, "Unable to determine supported "
+                           "advertise speeds\n");
                        return (ENODEV);
                }
        }
@@ -5590,42 +5581,48 @@
        /* Set new value and report new advertised mode */
        if (advertise & 0x1) {
                if (!(link_caps & IXGBE_LINK_SPEED_100_FULL)) {
-                       device_printf(dev, "Interface does not support 100Mb advertised speed\n");
+                       device_printf(dev, "Interface does not support 100Mb "
+                           "advertised speed\n");



Home | Main Index | Thread Index | Old Index