Module Name:    src
Committed By:   martin
Date:           Tue Feb  1 11:38:29 UTC 2022

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

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1734:

        sys/dev/pci/ixgbe/ixgbe.c                       1.264,1.269,1.272,
                                                        1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.48 -r1.88.2.49 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.88.2.48 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.49
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.48	Mon Jan 31 17:38:36 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Feb  1 11:38:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.48 2022/01/31 17:38:36 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.49 2022/02/01 11:38:29 martin Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.88.2.48 2022/01/31 17:38:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.88.2.49 2022/02/01 11:38:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -5074,28 +5074,34 @@ ixgbe_legacy_irq(void *arg)
 	struct ix_queue *que = arg;
 	struct adapter	*adapter = que->adapter;
 	struct ixgbe_hw	*hw = &adapter->hw;
-	struct ifnet	*ifp = adapter->ifp;
 	struct		tx_ring *txr = adapter->tx_rings;
 	bool		more = false;
 	u32		eicr, eicr_mask;
+	u32		eims_orig;
 
-	/* Silicon errata #26 on 82598 */
+	eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
+	/*
+	 * Silicon errata #26 on 82598. Disable all interrupts before reading
+	 * EICR.
+	 */
 	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
 
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
-	adapter->stats.pf.legint.ev_count++;
-	++que->irqs.ev_count;
 	if (eicr == 0) {
 		adapter->stats.pf.intzero.ev_count++;
-		if ((ifp->if_flags & IFF_UP) != 0)
-			ixgbe_enable_intr(adapter);
+		IXGBE_WRITE_REG(hw, IXGBE_EIMS, eims_orig);
 		return 0;
 	}
+	adapter->stats.pf.legint.ev_count++;
+
+	/* Queue (0) intr */
+	if ((eicr & IXGBE_EIMC_RTX_QUEUE) != 0) {
+		++que->irqs.ev_count;
 
-	if ((ifp->if_flags & IFF_RUNNING) != 0) {
 		/*
-		 * The same as ixgbe_msix_que() about "que->txrx_use_workqueue".
+		 * The same as ixgbe_msix_que() about
+		 * "que->txrx_use_workqueue".
 		 */
 		que->txrx_use_workqueue = adapter->txrx_use_workqueue;
 

Reply via email to