Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/dev/pci/ixgbe Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/473349919068
branches:  netbsd-8
changeset: 435237:473349919068
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Sep 05 08:42:22 2018 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #1006):

        sys/dev/pci/ixgbe/ixgbe.c: revision 1.164

  Fix a bug that media change may fail. I noticed that ifconfig ixgN media XXX
took a 10 or more seconds on a Denverton machie. I occurred by trying take a
lock and timed out. The reason was that ixgbe_media_change() didn't take
CORE_LOCK. Do it.

  This problem was from FreeBSD's pre-iflib ixgbe (I don't know whether this
problem really occurs on FreeBSD or not). Post-iflib ixgbe has no problem
because iflib_media_change() takes a lock.
XXX pullup-8

diffstat:

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

diffs (38 lines):

diff -r e0222cf50b09 -r 473349919068 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 05 08:40:05 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 05 08:42:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.22 2018/08/07 13:33:23 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.23 2018/09/05 08:42:22 martin Exp $ */
 
 /******************************************************************************
 
@@ -2841,6 +2841,7 @@
        if (hw->phy.media_type == ixgbe_media_type_backplane)
                return (EPERM);
 
+       IXGBE_CORE_LOCK(adapter);
        /*
         * We don't actually need to check against the supported
         * media types of the adapter; ifmedia will take care of
@@ -2853,6 +2854,7 @@
                if (err != IXGBE_SUCCESS) {
                        device_printf(adapter->dev, "Unable to determine "
                            "supported advertise speeds\n");
+                       IXGBE_CORE_UNLOCK(adapter);
                        return (ENODEV);
                }
                speed |= link_caps;
@@ -2913,10 +2915,12 @@
                        adapter->advertise |= 1 << 5;
        }
 
+       IXGBE_CORE_UNLOCK(adapter);
        return (0);
 
 invalid:
        device_printf(adapter->dev, "Invalid media type!\n");
+       IXGBE_CORE_UNLOCK(adapter);
 
        return (EINVAL);
 } /* ixgbe_media_change */



Home | Main Index | Thread Index | Old Index