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 Add IFF_RUNNING check in ixgbe_legacy_irq(...



details:   https://anonhg.NetBSD.org/src/rev/ab31d0b2ee98
branches:  trunk
changeset: 363406:ab31d0b2ee98
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Mar 10 03:53:46 2022 +0000

description:
Add IFF_RUNNING check in ixgbe_legacy_irq() again.

 - This change might fix small race between ifconfig down and an interrupt.
   If the race really exists, txeof() is called and it's not so dangerous.
   The rxeof is blocked in the beginning of ixgbe_handle_que().
 - This change makes consistent with ixgbe_handle_que().
 - Found and OK'd by knakahara.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 63da72f480fb -r ab31d0b2ee98 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Mar 10 00:14:33 2022 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Mar 10 03:53:46 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.307 2022/02/16 10:29:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.308 2022/03/10 03:53:46 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.307 2022/02/16 10:29:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.308 2022/03/10 03:53:46 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -5262,6 +5262,7 @@
        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;
        u32             eicr;
        u32             eims_orig;
@@ -5286,7 +5287,8 @@
        IXGBE_EVC_ADD(&adapter->stats.pf.legint, 1);
 
        /* Queue (0) intr */
-       if ((eicr & IXGBE_EIMC_RTX_QUEUE) != 0) {
+       if (((ifp->if_flags & IFF_RUNNING) != 0) &&
+           (eicr & IXGBE_EIMC_RTX_QUEUE) != 0) {
                IXGBE_EVC_ADD(&que->irqs, 1);
 
                /*



Home | Main Index | Thread Index | Old Index