Module Name:    src
Committed By:   martin
Date:           Tue Feb 17 14:54:37 UTC 2015

Modified Files:
        src/sys/dev/pci/ixgbe [netbsd-7]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #527):
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.15
  Fix a legacy interrupt problem. If the INTx line was shared with another
device, the ixgbe_legacy_irq() enabled the interrupt even if the interface
was down. Check the interface state and call functions appropriately.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.14 src/sys/dev/pci/ixgbe/ixgbe.c:1.14.2.1
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.14	Mon Apr 21 16:35:06 2014
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Feb 17 14:54:37 2015
@@ -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 2014/04/21 16:35:06 chs Exp $*/
+/*$NetBSD: ixgbe.c,v 1.14.2.1 2015/02/17 14:54:37 martin Exp $*/
 
 #include "opt_inet.h"
 
@@ -1478,30 +1478,33 @@ ixgbe_legacy_irq(void *arg)
 {
 	struct ix_queue *que = arg;
 	struct adapter	*adapter = que->adapter;
+	struct ifnet   *ifp = adapter->ifp;
 	struct ixgbe_hw	*hw = &adapter->hw;
 	struct 		tx_ring *txr = adapter->tx_rings;
-	bool		more_tx, more_rx;
+	bool		more_tx = false, more_rx = false;
 	u32       	reg_eicr, loop = MAX_LOOP;
 
-
 	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
 	adapter->stats.legint.ev_count++;
 	++que->irqs;
 	if (reg_eicr == 0) {
 		adapter->stats.intzero.ev_count++;
-		ixgbe_enable_intr(adapter);
+		if ((ifp->if_flags & IFF_UP) != 0)
+			ixgbe_enable_intr(adapter);
 		return 0;
 	}
 
-	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
+	if ((ifp->if_flags & IFF_RUNNING) != 0) {
+		more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
 
-	IXGBE_TX_LOCK(txr);
-	do {
-		adapter->txloops.ev_count++;
-		more_tx = ixgbe_txeof(txr);
-	} while (loop-- && more_tx);
-	IXGBE_TX_UNLOCK(txr);
+		IXGBE_TX_LOCK(txr);
+		do {
+			adapter->txloops.ev_count++;
+			more_tx = ixgbe_txeof(txr);
+		} while (loop-- && more_tx);
+		IXGBE_TX_UNLOCK(txr);
+	}
 
 	if (more_rx || more_tx) {
 		if (more_rx)

Reply via email to