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 revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/40d35d0f6c45
branches:  netbsd-7
changeset: 799023:40d35d0f6c45
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 24 10:41:09 2015 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #545):
        sys/dev/pci/ixgbe/ixgbe.h: revision 1.2
        sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.3
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.16
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.17
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.18
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.19
 Add missing IXGBE_RX_LOCK_DESTROY() for the detach path.
 Remove extra IXGBE_TX_LOCK()/IXGBE_TX_UNLOCK() from
ixgbe_free_transmit_structures(). This function is called in the end of
the detach function. if_stop was called and almost all resources were
freed, so it's not required to block the TX stuff.
Fix mutex related problem reported by Uwe Toenjes in PR#49328:
 - Revert ixgbe_netbsd.c rev. 1.2
 - make CORE_LOCK adaptive
 - Release spin lock while reinitializing the jumb buffer structure.
disable preemption while scheduling the softint to configure the link.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  19 ++++++++++++++-----
 sys/dev/pci/ixgbe/ixgbe.h |   4 ++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diffs (91 lines):

diff -r 9015c7a42776 -r 40d35d0f6c45 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon Feb 23 05:49:09 2015 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Tue Feb 24 10:41:09 2015 +0000
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: src/sys/dev/ixgbe/ixgbe.c,v 1.51 2011/04/25 23:34:21 jfv Exp $*/
-/*$NetBSD: ixgbe.c,v 1.14.2.1 2015/02/17 14:54:37 martin Exp $*/
+/*$NetBSD: ixgbe.c,v 1.14.2.2 2015/02/24 10:41:09 martin Exp $*/
 
 #include "opt_inet.h"
 
@@ -2710,13 +2710,19 @@
        sfp = ixgbe_is_sfp(hw);
 
        if (sfp) { 
+               void *ip;
+
                if (hw->phy.multispeed_fiber) {
                        hw->mac.ops.setup_sfp(hw);
                        ixgbe_enable_tx_laser(hw);
-                       softint_schedule(adapter->msf_si);
+                       ip = adapter->msf_si;
                } else {
-                       softint_schedule(adapter->mod_si);
+                       ip = adapter->mod_si;
                }
+
+               kpreempt_disable();
+               softint_schedule(ip);
+               kpreempt_enable();
        } else {
                if (hw->mac.ops.check_link)
                        err = ixgbe_check_link(hw, &autoneg,
@@ -3180,10 +3186,8 @@
        struct tx_ring *txr = adapter->tx_rings;
 
        for (int i = 0; i < adapter->num_queues; i++, txr++) {
-               IXGBE_TX_LOCK(txr);
                ixgbe_free_transmit_buffers(txr);
                ixgbe_dma_free(adapter, &txr->txdma);
-               IXGBE_TX_UNLOCK(txr);
                IXGBE_TX_LOCK_DESTROY(txr);
        }
        free(adapter->tx_rings, M_DEVBUF);
@@ -3935,12 +3939,16 @@
        /* Free current RX buffer structs and their mbufs */
        ixgbe_free_receive_ring(rxr);
 
+       IXGBE_RX_UNLOCK(rxr);
+
        /* Now reinitialize our supply of jumbo mbufs.  The number
         * or size of jumbo mbufs may have changed.
         */
        ixgbe_jcl_reinit(&adapter->jcl_head, rxr->ptag->dt_dmat,
            2 * adapter->num_rx_desc, adapter->rx_mbuf_sz);
 
+       IXGBE_RX_LOCK(rxr);
+
        /* Configure header split? */
        if (ixgbe_header_split)
                rxr->hdr_split = TRUE;
@@ -4226,6 +4234,7 @@
 #endif /* LRO */
                /* Free the ring memory as well */
                ixgbe_dma_free(adapter, &rxr->rxdma);
+               IXGBE_RX_LOCK_DESTROY(rxr);
        }
 
        free(adapter->rx_rings, M_DEVBUF);
diff -r 9015c7a42776 -r 40d35d0f6c45 sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Mon Feb 23 05:49:09 2015 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Tue Feb 24 10:41:09 2015 +0000
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: src/sys/dev/ixgbe/ixgbe.h,v 1.24 2011/04/28 23:21:40 jfv Exp $*/
-/*$NetBSD: ixgbe.h,v 1.1 2011/08/12 21:55:29 dyoung Exp $*/
+/*$NetBSD: ixgbe.h,v 1.1.28.1 2015/02/24 10:41:09 martin Exp $*/
 
 
 #ifndef _IXGBE_H_
@@ -476,7 +476,7 @@
 
 
 #define IXGBE_CORE_LOCK_INIT(_sc, _name) \
-        mutex_init(&(_sc)->core_mtx, MUTEX_DEFAULT, IPL_NET)
+        mutex_init(&(_sc)->core_mtx, MUTEX_DEFAULT, IPL_SOFTNET)
 #define IXGBE_CORE_LOCK_DESTROY(_sc)      mutex_destroy(&(_sc)->core_mtx)
 #define IXGBE_TX_LOCK_DESTROY(_sc)        mutex_destroy(&(_sc)->tx_mtx)
 #define IXGBE_RX_LOCK_DESTROY(_sc)        mutex_destroy(&(_sc)->rx_mtx)



Home | Main Index | Thread Index | Old Index