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 the first call of ifflags_c...



details:   https://anonhg.NetBSD.org/src/rev/ae7cc4d9a739
branches:  trunk
changeset: 359584:ae7cc4d9a739
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Feb 16 10:11:21 2018 +0000

description:
Fix a bug that the first call of ifflags_cb() causes linkdown. The first
call of ix(gbe|v)_ifflags_cb() refered uninitialized adapter->if_flags.
adapter->if_flags should be initialized in the end of xxx_init().

XXX pullup-[678] (ixgbe)
XXX pullup-8 (ixv)

diffstat:

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

diffs (38 lines):

diff -r ffc47065d8df -r ae7cc4d9a739 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 16 10:07:07 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 16 10:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.122 2018/02/16 04:50:19 knakahara Exp $ */
+/* $NetBSD: ixgbe.c,v 1.123 2018/02/16 10:11:21 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -3779,6 +3779,9 @@
                IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
        }
 
+       /* Update saved flags. See ixgbe_ifflags_cb() */
+       adapter->if_flags = ifp->if_flags;
+
        /* Now inform the stack we're ready */
        ifp->if_flags |= IFF_RUNNING;
 
diff -r ffc47065d8df -r ae7cc4d9a739 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Fri Feb 16 10:07:07 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Fri Feb 16 10:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.78 2018/02/16 04:50:19 knakahara Exp $*/
+/*$NetBSD: ixv.c,v 1.79 2018/02/16 10:11:21 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -785,6 +785,9 @@
        /* And now turn on interrupts */
        ixv_enable_intr(adapter);
 
+       /* Update saved flags. See ixgbe_ifflags_cb() */
+       adapter->if_flags = ifp->if_flags;
+
        /* Now inform the stack we're ready */
        ifp->if_flags |= IFF_RUNNING;
        ifp->if_flags &= ~IFF_OACTIVE;



Home | Main Index | Thread Index | Old Index