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 Fix a bug that ix*_start_locked() is calle...



details:   https://anonhg.NetBSD.org/src/rev/e5eb40e6f585
branches:  trunk
changeset: 351436:e5eb40e6f585
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Feb 13 06:38:45 2017 +0000

description:
Fix a bug that ix*_start_locked() is called in interrput context
(ix*_msix_que). The function is called in softint(ix*_handle_que()). OK'd by
k-nakahara.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  14 +++++---------
 sys/dev/pci/ixgbe/ixv.c   |  16 +++++++---------
 2 files changed, 12 insertions(+), 18 deletions(-)

diffs (86 lines):

diff -r 2dfaac9f80ce -r e5eb40e6f585 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon Feb 13 06:11:01 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Mon Feb 13 06:38:45 2017 +0000
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.73 2017/02/10 08:41:13 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.74 2017/02/13 06:38:45 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1700,9 +1700,6 @@
 #ifdef IXGBE_LEGACY_TX
        if (!IFQ_IS_EMPTY(&adapter->ifp->if_snd))
                ixgbe_start_locked(txr, ifp);
-#else
-       if (pcq_peek(txr->txr_interq) != NULL)
-               ixgbe_mq_start_locked(ifp, txr);
 #endif
        IXGBE_TX_UNLOCK(txr);
 
@@ -3005,11 +3002,10 @@
 
        if_initialize(ifp);
        ether_ifattach(ifp, adapter->hw.mac.addr);
-#ifndef IXGBE_LEGACY_TX
-#if 0  /* We use per TX queue softint */
-       if_deferred_start_init(ifp, ixgbe_deferred_mq_start);
-#endif
-#endif
+       /*
+        * We use per TX queue softint, so if_deferred_start_init() isn't
+        * used.
+        */
        if_register(ifp);
        ether_set_ifflags_cb(ec, ixgbe_ifflags_cb);
 
diff -r 2dfaac9f80ce -r e5eb40e6f585 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Mon Feb 13 06:11:01 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Mon Feb 13 06:38:45 2017 +0000
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.50 2017/02/10 08:41:13 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.51 2017/02/13 06:38:45 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -912,7 +912,9 @@
 {
        struct ix_queue *que = arg;
        struct adapter  *adapter = que->adapter;
+#ifdef IXGBE_LEGACY_TX
        struct ifnet    *ifp = adapter->ifp;
+#endif
        struct tx_ring  *txr = que->txr;
        struct rx_ring  *rxr = que->rxr;
        bool            more;
@@ -938,9 +940,6 @@
 #ifdef IXGBE_LEGACY_TX
        if (!IFQ_IS_EMPTY(&adapter->ifp->if_snd))
                ixgbe_start_locked(txr, ifp);
-#else
-       if (pcq_peek(txr->txr_interq) != NULL)
-               ixgbe_mq_start_locked(ifp, txr);
 #endif
        IXGBE_TX_UNLOCK(txr);
 
@@ -1678,11 +1677,10 @@
 
        if_initialize(ifp);
        ether_ifattach(ifp, adapter->hw.mac.addr);
-#ifndef IXGBE_LEGACY_TX
-#if 0  /* We use per TX queue softint */
-       if_deferred_start_init(ifp, ixgbe_deferred_mq_start);
-#endif
-#endif
+       /*
+        * We use per TX queue softint, so if_deferred_start_init() isn't
+        * used.
+        */
        if_register(ifp);
        ether_set_ifflags_cb(ec, ixv_ifflags_cb);
 



Home | Main Index | Thread Index | Old Index