Source-Changes-HG archive

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

src: Pull up following revision(s) (requested by msaitoh in tick...



details:   https://anonhg.NetBSD.org/src/rev/a147941dcc96
branches:  netbsd-8
changeset: 318163:a147941dcc96
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Apr 14 10:25:11 2018 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #750):

        sys/dev/pci/ixgbe/ixgbe_x540.h: revision 1.8
        sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.11
        sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.6
        sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.12
        sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.7
        sys/dev/pci/ixgbe/ixgbe_dcb_82598.h: revision 1.6
        sys/dev/pci/ixgbe/ixgbe_fdir.h: revision 1.2
        sys/dev/pci/ixgbe/ixgbe_dcb_82599.h: revision 1.6
        sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.6
        sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.18
        sys/dev/pci/ixgbe/if_sriov.c: revision 1.3
        sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.7
        sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.19
        sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.13
        sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.7
        sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.19
        sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.16
        sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.8
        sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.17
        sys/dev/pci/ixgbe/ixgbe_dcb.h: revision 1.6
        sys/dev/pci/ixgbe/if_bypass.c: revision 1.4
        sys/dev/pci/ixgbe/ixv.c: revision 1.91
        sys/dev/pci/ixgbe/ixgbe_rss.h: revision 1.4
        sys/dev/pci/ixgbe/ixv.c: revision 1.92
        sys/dev/pci/ixgbe/ixv.c: revision 1.93
        sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.4
        sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.12
        sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.13
        sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.13
        sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.12
        sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.33
        sys/dev/pci/ixgbe/if_fdir.c: revision 1.2
        sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.34
        sys/dev/pci/ixgbe/ix_txrx.c: revision 1.39
        sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.13
        sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.20
        sys/dev/pci/ixgbe/ixgbe_sriov.h: revision 1.3
        sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.21
        sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.21
        sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.22
        sys/dev/pci/ixgbe/ixgbe_82599.h: revision 1.7
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.144
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.145
        sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.16
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.146
        sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.17
        sys/dev/pci/ixgbe/ixgbe_82598.h: revision 1.8
        sys/dev/pci/ixgbe/ixgbe.h: revision 1.41
        sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.10
        sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.14
        sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.15
        sys/dev/pci/ixgbe/ixgbe_phy.h: revision 1.11

Sync with the remaining part of FreeBSD r328265 except sfp_reinit stuff:
 - Always schedule module intterrupt in ixgbe_config_link() when a device is
   SFP+ based.
 - Use not loop index but txr->me in ixv_initialize_{transmit,receive}_units().
   It's required for VMDQ but NetBSD doesn't use it, so it's not a bug in
   NetBSD.
 - Simplify ixgbe_bp_wd_set(). No functional change.
 - Whitespace.

Sync with FreeBSD r331224 except ixv_if_update_admin_status()'s change:
 - Fix length of reading buffer when the command is Read Flash in
   ixgbe_host_interface_command().
 - Add missing start_hw() call in ixv_init_locked(). This is not a real bug
   because start_hw just set hw->adapter_stopped to false and anyone refer it.
 - Style change.
 - Update comment.

Read sc_if_flags after taking core lock. Same as if_wm.c rev. 1.418.

diffstat:

 sys/dev/pci/ixgbe/if_bypass.c       |  51 ++++++++++---------------
 sys/dev/pci/ixgbe/if_fdir.c         |   2 +-
 sys/dev/pci/ixgbe/if_sriov.c        |  14 +++---
 sys/dev/pci/ixgbe/ix_txrx.c         |   4 +-
 sys/dev/pci/ixgbe/ixgbe.c           |  74 ++++++++++++++++++-------------------
 sys/dev/pci/ixgbe/ixgbe.h           |   4 +-
 sys/dev/pci/ixgbe/ixgbe_82598.c     |   7 ++-
 sys/dev/pci/ixgbe/ixgbe_82598.h     |   4 +-
 sys/dev/pci/ixgbe/ixgbe_82599.c     |  18 ++++++--
 sys/dev/pci/ixgbe/ixgbe_82599.h     |   4 +-
 sys/dev/pci/ixgbe/ixgbe_api.c       |  20 ++++++++-
 sys/dev/pci/ixgbe/ixgbe_api.h       |   4 +-
 sys/dev/pci/ixgbe/ixgbe_common.c    |  38 +++++++++++++++---
 sys/dev/pci/ixgbe/ixgbe_common.h    |   4 +-
 sys/dev/pci/ixgbe/ixgbe_dcb.c       |  12 ++++-
 sys/dev/pci/ixgbe/ixgbe_dcb.h       |   2 +-
 sys/dev/pci/ixgbe/ixgbe_dcb_82598.c |  24 +++++++++---
 sys/dev/pci/ixgbe/ixgbe_dcb_82598.h |   2 +-
 sys/dev/pci/ixgbe/ixgbe_dcb_82599.c |  27 +++++++++++--
 sys/dev/pci/ixgbe/ixgbe_dcb_82599.h |   2 +-
 sys/dev/pci/ixgbe/ixgbe_fdir.h      |   2 +-
 sys/dev/pci/ixgbe/ixgbe_mbx.c       |   4 +-
 sys/dev/pci/ixgbe/ixgbe_mbx.h       |   4 +-
 sys/dev/pci/ixgbe/ixgbe_osdep.c     |   4 +-
 sys/dev/pci/ixgbe/ixgbe_osdep.h     |   4 +-
 sys/dev/pci/ixgbe/ixgbe_phy.c       |  23 +++++++++--
 sys/dev/pci/ixgbe/ixgbe_phy.h       |   4 +-
 sys/dev/pci/ixgbe/ixgbe_rss.h       |   2 +-
 sys/dev/pci/ixgbe/ixgbe_sriov.h     |   4 +-
 sys/dev/pci/ixgbe/ixgbe_type.h      |  11 +----
 sys/dev/pci/ixgbe/ixgbe_vf.c        |  11 +++--
 sys/dev/pci/ixgbe/ixgbe_vf.h        |   4 +-
 sys/dev/pci/ixgbe/ixgbe_x540.c      |   2 +-
 sys/dev/pci/ixgbe/ixgbe_x540.h      |   2 +-
 sys/dev/pci/ixgbe/ixgbe_x550.c      |  14 ++++++-
 sys/dev/pci/ixgbe/ixv.c             |  69 ++++++++++++++++++----------------
 36 files changed, 286 insertions(+), 195 deletions(-)

diffs (truncated from 1863 to 300 lines):

diff -r 4cb296a9cfb1 -r a147941dcc96 sys/dev/pci/ixgbe/if_bypass.c
--- a/sys/dev/pci/ixgbe/if_bypass.c     Sat Apr 14 10:16:19 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_bypass.c     Sat Apr 14 10:25:11 2018 +0000
@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 327031 2017-12-20 18:15:06Z erj $*/
 
 
 #include "ixgbe.h"
@@ -168,13 +168,13 @@
        error = hw->mac.ops.bypass_rw(hw,
            BYPASS_PAGE_CTL0, &state);
        ixgbe_bypass_mutex_clear(adapter);
-       if (error)
+       if (error != 0)
                return (error);
        state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3;
 
        node.sysctl_data = &state;
        error = sysctl_lookup(SYSCTLFN_CALL(&node));
-       if ((error) || (newp == NULL))
+       if ((error != 0) || (newp == NULL))
                return (error);
 
        /* Sanity check new state */
@@ -452,7 +452,7 @@
        struct ixgbe_hw *hw = &adapter->hw;
        int             error, tmp;
        static int      timeout = 0;
-       u32             mask, arg = BYPASS_PAGE_CTL0;
+       u32             mask, arg;
 
        /* Get the current hardware value */
        ixgbe_bypass_mutex_enter(adapter);
@@ -472,48 +472,38 @@
        if ((error) || (newp == NULL))
                return (error);
 
-       mask = BYPASS_WDT_ENABLE_M;
+       arg = 0x1 << BYPASS_WDT_ENABLE_SHIFT;
+       mask = BYPASS_WDT_ENABLE_M | BYPASS_WDT_VALUE_M;
        switch (timeout) {
        case 0: /* disables the timer */
+               arg = BYPASS_PAGE_CTL0;
+               mask = BYPASS_WDT_ENABLE_M;
                break;
        case 1:
-               arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 2:
-               arg = BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 3:
-               arg = BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 4:
-               arg = BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 8:
-               arg = BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 16:
-               arg = BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT;
                break;
        case 32:
-               arg = BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT;
-               arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-               mask |= BYPASS_WDT_VALUE_M;
+               arg |= BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT;
                break;
        default:
                return (EINVAL);
        }
+
        /* Set the new watchdog */
        ixgbe_bypass_mutex_enter(adapter);
        error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg);
@@ -559,7 +549,8 @@
                        error = IXGBE_BYPASS_FW_WRITE_FAILURE;
                        break;
                }
-               if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) {
+               error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd);
+               if (error != 0) {
                        error = IXGBE_ERR_INVALID_ARGUMENT;
                        break;
                }
@@ -724,7 +715,7 @@
        /* Another log command can now run */
        while (atomic_cas_uint(&adapter->bypass.log, 1, 0) == 0)
                usec_delay(3000);
-       return(error);
+       return (error);
 
 unlock_err:
        ixgbe_bypass_mutex_clear(adapter);
@@ -745,9 +736,9 @@
 {
        struct ixgbe_hw        *hw = &adapter->hw;
        device_t               dev = adapter->dev;
-       u32                    mask, value, sec, year;
        struct                 sysctllog **log;
        const struct sysctlnode *rnode, *cnode;
+       u32                    mask, value, sec, year;
 
        if (!(adapter->feat_cap & IXGBE_FEATURE_BYPASS))
                return;
@@ -825,7 +816,5 @@
            ixgbe_bp_wd_reset, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL);
 
        adapter->feat_en |= IXGBE_FEATURE_BYPASS;
-
-       return;
 } /* ixgbe_bypass_init */
 
diff -r 4cb296a9cfb1 -r a147941dcc96 sys/dev/pci/ixgbe/if_fdir.c
--- a/sys/dev/pci/ixgbe/if_fdir.c       Sat Apr 14 10:16:19 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_fdir.c       Sat Apr 14 10:25:11 2018 +0000
@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include "ixgbe.h"
 
diff -r 4cb296a9cfb1 -r a147941dcc96 sys/dev/pci/ixgbe/if_sriov.c
--- a/sys/dev/pci/ixgbe/if_sriov.c      Sat Apr 14 10:16:19 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_sriov.c      Sat Apr 14 10:25:11 2018 +0000
@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include "ixgbe.h"
 #include "ixgbe_sriov.h"
@@ -90,26 +90,26 @@
 
 /* Support functions for SR-IOV/VF management */
 static inline void
-ixgbe_send_vf_msg(struct ixgbe_hw *hw, struct ixgbe_vf *vf, u32 msg)
+ixgbe_send_vf_msg(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
 {
        if (vf->flags & IXGBE_VF_CTS)
                msg |= IXGBE_VT_MSGTYPE_CTS;
 
-       hw->mbx.ops.write(hw, &msg, 1, vf->pool);
+       adapter->hw.mbx.ops.write(&adapter->hw, &msg, 1, vf->pool);
 }
 
 static inline void
 ixgbe_send_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
 {
        msg &= IXGBE_VT_MSG_MASK;
-       ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_ACK);
+       ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_ACK);
 }
 
 static inline void
 ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
 {
        msg &= IXGBE_VT_MSG_MASK;
-       ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_NACK);
+       ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK);
 }
 
 static inline void
@@ -205,7 +205,7 @@
        for (int i = 0; i < adapter->num_vfs; i++) {
                vf = &adapter->vfs[i];
                if (vf->flags & IXGBE_VF_ACTIVE)
-                       ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG);
+                       ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
        }
 } /* ixgbe_ping_all_vfs */
 
@@ -775,7 +775,7 @@
        ixgbe_vf_enable_transmit(adapter, vf);
        ixgbe_vf_enable_receive(adapter, vf);
 
-       ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG);
+       ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
 } /* ixgbe_init_vf */
 
 void
diff -r 4cb296a9cfb1 -r a147941dcc96 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Sat Apr 14 10:16:19 2018 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Sat Apr 14 10:25:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.9 2018/04/04 16:18:49 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.10 2018/04/14 10:25:11 martin Exp $ */
 
 /******************************************************************************
 
@@ -32,7 +32,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 321476 2017-07-25 14:38:30Z sbruno $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 327031 2017-12-20 18:15:06Z erj $*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
diff -r 4cb296a9cfb1 -r a147941dcc96 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Sat Apr 14 10:16:19 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Sat Apr 14 10:25:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.16 2018/04/04 16:18:49 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.17 2018/04/14 10:25:11 martin Exp $ */
 
 /******************************************************************************
 
@@ -32,7 +32,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 320916 2017-07-12 17:35:32Z sbruno $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 331224 2018-03-19 20:55:05Z erj $*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 /************************************************************************
  * Driver version
  ************************************************************************/
-char ixgbe_driver_version[] = "3.2.12-k";
+char ixgbe_driver_version[] = "4.0.1-k";
 
 
 /************************************************************************
@@ -669,7 +669,6 @@
 
        IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
 
-       return;
 } /* ixgbe_initialize_receive_units */
 
 /************************************************************************
@@ -680,9 +679,10 @@
 {
        struct tx_ring  *txr = adapter->tx_rings;
        struct ixgbe_hw *hw = &adapter->hw;
+       int i;
 
        /* Setup the Base and Length of the Tx Descriptor Ring */
-       for (int i = 0; i < adapter->num_queues; i++, txr++) {
+       for (i = 0; i < adapter->num_queues; i++, txr++) {
                u64 tdba = txr->txdma.dma_paddr;
                u32 txctrl = 0;
                int j = txr->me;
@@ -827,7 +827,7 @@
        /*
         * Initialize the shared code
         */
-       if (ixgbe_init_shared_code(hw)) {
+       if (ixgbe_init_shared_code(hw) != 0) {
                aprint_error_dev(dev, "Unable to initialize the shared code\n");
                error = ENXIO;
                goto err_out;
@@ -1466,23 +1466,23 @@
        switch (hw->mac.type) {
        case ixgbe_mac_82598EB:
                if (hw->phy.type == ixgbe_phy_nl)
-                       return TRUE;
-               return FALSE;
+                       return (TRUE);
+               return (FALSE);
        case ixgbe_mac_82599EB:
                switch (hw->mac.ops.get_media_type(hw)) {
                case ixgbe_media_type_fiber:
                case ixgbe_media_type_fiber_qsfp:
-                       return TRUE;
+                       return (TRUE);
                default:
-                       return FALSE;
+                       return (FALSE);



Home | Main Index | Thread Index | Old Index