Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/pci/ixgbe Pull up following revisions (requested ...



details:   https://anonhg.NetBSD.org/src/rev/2bb5c3e7cc65
branches:  netbsd-7
changeset: 799279:2bb5c3e7cc65
user:      riz <riz%NetBSD.org@localhost>
date:      Wed May 06 23:29:21 2015 +0000

description:
Pull up following revisions (requested by msaitoh in ticket #734):
sys/dev/pci/ixgbe/LICENSE                       1.2
sys/dev/pci/ixgbe/ixgbe.c                       1.28-1.29
sys/dev/pci/ixgbe/ixgbe.h                       1.7
sys/dev/pci/ixgbe/ixgbe_82598.c                 1.4
sys/dev/pci/ixgbe/ixgbe_82598.h                 1.3
sys/dev/pci/ixgbe/ixgbe_82599.c                 1.9
sys/dev/pci/ixgbe/ixgbe_82599.h                 1.2
sys/dev/pci/ixgbe/ixgbe_api.c                   1.7
sys/dev/pci/ixgbe/ixgbe_api.h                   1.4
sys/dev/pci/ixgbe/ixgbe_common.c                1.5
sys/dev/pci/ixgbe/ixgbe_common.h                1.4
sys/dev/pci/ixgbe/ixgbe_mbx.h                   1.4
sys/dev/pci/ixgbe/ixgbe_netbsd.h                1.3
sys/dev/pci/ixgbe/ixgbe_osdep.h                 1.7
sys/dev/pci/ixgbe/ixgbe_phy.c                   1.5
sys/dev/pci/ixgbe/ixgbe_phy.h                   1.4
sys/dev/pci/ixgbe/ixgbe_type.h                  1.10
sys/dev/pci/ixgbe/ixgbe_vf.c                    1.4
sys/dev/pci/ixgbe/ixgbe_vf.h                    1.5
sys/dev/pci/ixgbe/ixgbe_x540.c                  1.3
sys/dev/pci/ixgbe/ixgbe_x540.h                  1.2
sys/dev/pci/ixgbe/ixv.c                         1.8

        - Sync ixg(4) up to FreeBSD r250108:
          - Cleanup some unused counters and some unused code.
          - Improve performance.
          - Fix flow control - don't override user value on re-init
          - Fix to make 1G optics work correctly
          - Change to interrupt enabling - some bits were incorrect
            for certain hardware.
          - Certain stats fixes, remove a duplicate increment of
            ierror, thanks to Scott Long for pointing these out.
          - Fix the setting of RX which related to multicast.
          - Some netmap related fixes.
        - Fixes link error without vlan. PR#49879 reported by Hauke Fath.
        [msaitoh, ticket #734]

diffstat:

 sys/dev/pci/ixgbe/LICENSE        |    6 +-
 sys/dev/pci/ixgbe/ixgbe.c        |  827 +++++++++++++++++++-------------------
 sys/dev/pci/ixgbe/ixgbe.h        |   65 +-
 sys/dev/pci/ixgbe/ixgbe_82598.c  |   64 ++-
 sys/dev/pci/ixgbe/ixgbe_82598.h  |    2 +-
 sys/dev/pci/ixgbe/ixgbe_82599.c  |  383 ++++++++++++++---
 sys/dev/pci/ixgbe/ixgbe_82599.h  |   11 +-
 sys/dev/pci/ixgbe/ixgbe_api.c    |  111 ++--
 sys/dev/pci/ixgbe/ixgbe_api.h    |   10 +-
 sys/dev/pci/ixgbe/ixgbe_common.c |  278 ++++++++++++-
 sys/dev/pci/ixgbe/ixgbe_common.h |   27 +-
 sys/dev/pci/ixgbe/ixgbe_mbx.h    |   18 +-
 sys/dev/pci/ixgbe/ixgbe_netbsd.h |    4 +-
 sys/dev/pci/ixgbe/ixgbe_osdep.h  |    9 +-
 sys/dev/pci/ixgbe/ixgbe_phy.c    |   59 +-
 sys/dev/pci/ixgbe/ixgbe_phy.h    |   26 +-
 sys/dev/pci/ixgbe/ixgbe_type.h   |   48 +-
 sys/dev/pci/ixgbe/ixgbe_vf.c     |  131 +++++-
 sys/dev/pci/ixgbe/ixgbe_vf.h     |   15 +-
 sys/dev/pci/ixgbe/ixgbe_x540.c   |   12 +-
 sys/dev/pci/ixgbe/ixgbe_x540.h   |    6 +-
 sys/dev/pci/ixgbe/ixv.c          |   43 +-
 22 files changed, 1430 insertions(+), 725 deletions(-)

diffs (truncated from 4581 to 300 lines):

diff -r 8df998877d4f -r 2bb5c3e7cc65 sys/dev/pci/ixgbe/LICENSE
--- a/sys/dev/pci/ixgbe/LICENSE Mon May 04 20:25:57 2015 +0000
+++ b/sys/dev/pci/ixgbe/LICENSE Wed May 06 23:29:21 2015 +0000
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2010, Intel Corporation 
+  Copyright (c) 2001-2013, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -30,5 +30,5 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: src/sys/dev/ixgbe/LICENSE,v 1.4 2010/03/27 00:21:40 jfv Exp $*/
-/*$NetBSD: LICENSE,v 1.1 2011/08/12 21:55:28 dyoung Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/LICENSE 247822 2013-03-04 23:07:40Z jfv $*/
+/*$NetBSD: LICENSE,v 1.1.28.1 2015/05/06 23:29:21 riz Exp $*/
diff -r 8df998877d4f -r 2bb5c3e7cc65 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon May 04 20:25:57 2015 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed May 06 23:29:21 2015 +0000
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2012, Intel Corporation 
+  Copyright (c) 2001-2013, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -58,13 +58,14 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 243716 2012-11-30 22:33:21Z jfv $*/
-/*$NetBSD: ixgbe.c,v 1.14.2.4 2015/04/19 06:45:17 riz Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 250108 2013-04-30 16:18:29Z luigi $*/
+/*$NetBSD: ixgbe.c,v 1.14.2.5 2015/05/06 23:29:21 riz Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
 #include "ixgbe.h"
+#include "vlan.h"
 
 /*********************************************************************
  *  Set this to one to display debug statistics
@@ -74,7 +75,7 @@
 /*********************************************************************
  *  Driver version
  *********************************************************************/
-char ixgbe_driver_version[] = "2.5.0 - 2";
+char ixgbe_driver_version[] = "2.5.8 - HEAD";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -111,7 +112,6 @@
        {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0},
        {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0},
        {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0},
-       {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0},
        {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0},
        /* required last entry */
        {0, 0, 0, 0, 0}
@@ -134,15 +134,15 @@
 #if 0
 static int      ixgbe_shutdown(device_t);
 #endif
-#if __FreeBSD_version >= 800000
+#if IXGBE_LEGACY_TX
+static void     ixgbe_start(struct ifnet *);
+static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
+#else
 static int     ixgbe_mq_start(struct ifnet *, struct mbuf *);
 static int     ixgbe_mq_start_locked(struct ifnet *,
                     struct tx_ring *, struct mbuf *);
 static void    ixgbe_qflush(struct ifnet *);
-static void    ixgbe_deferred_mq_start(void *, int);
-#else
-static void     ixgbe_start(struct ifnet *);
-static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
+static void    ixgbe_deferred_mq_start(void *);
 #endif
 static int      ixgbe_ioctl(struct ifnet *, u_long, void *);
 static void    ixgbe_ifstop(struct ifnet *, int);
@@ -184,7 +184,7 @@
 static void     ixgbe_disable_intr(struct adapter *);
 static void     ixgbe_update_stats_counters(struct adapter *);
 static bool    ixgbe_txeof(struct tx_ring *);
-static bool    ixgbe_rxeof(struct ix_queue *, int);
+static bool    ixgbe_rxeof(struct ix_queue *);
 static void    ixgbe_rx_checksum(u32, struct mbuf *, u32,
                    struct ixgbe_hw_stats *);
 static void     ixgbe_set_promisc(struct adapter *);
@@ -198,10 +198,10 @@
 static int     ixgbe_dma_malloc(struct adapter *, bus_size_t,
                    struct ixgbe_dma_alloc *, int);
 static void     ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *);
-static void    ixgbe_add_rx_process_limit(struct adapter *, const char *,
-                   const char *, int *, int);
-static u32     ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
-static bool    ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *);
+static int     ixgbe_tx_ctx_setup(struct tx_ring *,
+                   struct mbuf *, u32 *, u32 *);
+static int     ixgbe_tso_setup(struct tx_ring *,
+                   struct mbuf *, u32 *, u32 *);
 static void    ixgbe_set_ivar(struct adapter *, u8, u8, s8);
 static void    ixgbe_configure_ivars(struct adapter *);
 static u8 *    ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
@@ -285,6 +285,10 @@
 static int ixgbe_rx_process_limit = 256;
 TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);
 
+/* How many packets txeof tries to clean at a time */
+static int ixgbe_tx_process_limit = 256;
+TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit);
+
 /*
 ** Smart speed setting, default to on
 ** this only works as a compile option
@@ -641,11 +645,6 @@
        if (ixgbe_setup_interface(dev, adapter) != 0)
                goto err_late;
 
-       /* Sysctl for limiting the amount of work done in software interrupts */
-       ixgbe_add_rx_process_limit(adapter, "rx_processing_limit",
-           "max number of rx packets to process", &adapter->rx_process_limit,
-           ixgbe_rx_process_limit);
-
        /* Initialize statistics */
        ixgbe_update_stats_counters(adapter);
 
@@ -668,6 +667,9 @@
                    "PCIE, or x4 PCIE 2 slot is required.\n");
         }
 
+       /* Set an initial default flow control value */
+       adapter->fc =  ixgbe_fc_full;
+
        /* let hardware know driver is loaded */
        ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
        ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD;
@@ -715,6 +717,7 @@
 
        INIT_DEBUGOUT("ixgbe_detach: begin");
 
+#if NVLAN > 0
        /* Make sure VLANs are not using driver */
        if (!VLAN_ATTACHED(&adapter->osdep.ec))
                ;       /* nothing to do: no VLANs */ 
@@ -724,13 +727,14 @@
                aprint_error_dev(dev, "VLANs in use\n");
                return EBUSY;
        }
+#endif
 
        IXGBE_CORE_LOCK(adapter);
        ixgbe_stop(adapter);
        IXGBE_CORE_UNLOCK(adapter);
 
        for (int i = 0; i < adapter->num_queues; i++, que++, txr++) {
-#if __FreeBSD_version >= 800000
+#ifndef IXGBE_LEGACY_TX
                softint_disestablish(txr->txq_si);
 #endif
                softint_disestablish(que->que_si);
@@ -775,13 +779,13 @@
        evcnt_detach(&adapter->enomem_tx_dma_setup);
        evcnt_detach(&adapter->watchdog_events);
        evcnt_detach(&adapter->tso_err);
-       evcnt_detach(&adapter->tso_tx);
        evcnt_detach(&adapter->link_irq);
 
        txr = adapter->tx_rings;
        for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
                evcnt_detach(&txr->no_desc_avail);
                evcnt_detach(&txr->total_packets);
+               evcnt_detach(&txr->tso_tx);
 
                if (i < __arraycount(adapter->stats.mpc)) {
                        evcnt_detach(&adapter->stats.mpc[i]);
@@ -859,17 +863,6 @@
        evcnt_detach(&stats->ptc1023);
        evcnt_detach(&stats->ptc1522);
 
-       /* FC Stats */
-       evcnt_detach(&stats->fccrc);
-       evcnt_detach(&stats->fclast);
-       if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
-               evcnt_detach(&stats->fcoerpdc);
-               evcnt_detach(&stats->fcoeprc);
-               evcnt_detach(&stats->fcoeptc);
-               evcnt_detach(&stats->fcoedwrc);
-               evcnt_detach(&stats->fcoedwtc);
-       }
-
        ixgbe_free_transmit_structures(adapter);
        ixgbe_free_receive_structures(adapter);
        free(adapter->mta, M_DEVBUF);
@@ -897,7 +890,7 @@
 #endif
 
 
-#if __FreeBSD_version < 800000
+#ifdef IXGBE_LEGACY_TX
 /*********************************************************************
  *  Transmit entry point
  *
@@ -937,7 +930,7 @@
                if (rc == EFBIG) {
                        struct mbuf *mtmp;
 
-                       if ((mtmp = m_defrag(m_head, M_DONTWAIT)) != NULL) {
+                       if ((mtmp = m_defrag(m_head, M_NOWAIT)) != NULL) {
                                m_head = mtmp;
                                rc = ixgbe_xmit(txr, m_head);
                                if (rc != 0)
@@ -980,7 +973,8 @@
        return;
 }
 
-#else
+#else /* ! IXGBE_LEGACY_TX */
+
 /*
 ** Multiqueue Transmit driver
 **
@@ -997,7 +991,7 @@
        if ((m->m_flags & M_FLOWID) != 0)
                i = m->m_pkthdr.flowid % adapter->num_queues;
        else
-               i = curcpu % adapter->num_queues;
+               i = cpu_index(curcpu()) % adapter->num_queues;
 
        txr = &adapter->tx_rings[i];
        que = &adapter->queues[i];
@@ -1028,22 +1022,24 @@
        }
 
        enqueued = 0;
-       if (m == NULL) {
-               next = drbr_dequeue(ifp, txr->br);
-       } else if (drbr_needs_enqueue(ifp, txr->br)) {
-               if ((err = drbr_enqueue(ifp, txr->br, m)) != 0)
+       if (m != NULL) {
+               err = drbr_enqueue(ifp, txr->br, m);
+               if (err) {
                        return (err);
-               next = drbr_dequeue(ifp, txr->br);
-       } else
-               next = m;
+               }
+       }
 
        /* Process the queue */
-       while (next != NULL) {
+       while ((next = drbr_peek(ifp, txr->br)) != NULL) {
                if ((err = ixgbe_xmit(txr, &next)) != 0) {
-                       if (next != NULL)
-                               err = drbr_enqueue(ifp, txr->br, next);
+                       if (next == NULL) {
+                               drbr_advance(ifp, txr->br);
+                       } else {
+                               drbr_putback(ifp, txr->br, next);
+                       }
                        break;
                }
+               drbr_advance(ifp, txr->br);
                enqueued++;
                /* Send a copy of the frame to the BPF listener */
                bpf_mtap(ifp, next);
@@ -1051,7 +1047,6 @@
                        break;
                if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD)
                        ixgbe_txeof(txr);
-               next = drbr_dequeue(ifp, txr->br);
        }
 
        if (enqueued > 0) {
@@ -1070,7 +1065,7 @@
  * Called from a taskqueue to drain queued transmit packets.
  */
 static void
-ixgbe_deferred_mq_start(void *arg, int pending)
+ixgbe_deferred_mq_start(void *arg)
 {
        struct tx_ring *txr = arg;
        struct adapter *adapter = txr->adapter;
@@ -1100,7 +1095,7 @@
        }
        if_qflush(ifp);
 }
-#endif /* __FreeBSD_version >= 800000 */
+#endif /* IXGBE_LEGACY_TX */
 
 static int
 ixgbe_ifflags_cb(struct ethercom *ec)
@@ -1140,6 +1135,7 @@
 ixgbe_ioctl(struct ifnet * ifp, u_long command, void *data)
 {



Home | Main Index | Thread Index | Old Index