Module Name:    src
Committed By:   msaitoh
Date:           Tue Jan 13 03:11:34 UTC 2015

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 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.15 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.15
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.14	Mon Apr 21 16:35:06 2014
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Jan 13 03:11:34 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.15 2015/01/13 03:11:34 msaitoh 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