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 Remove vlan_ifdetach() from ixgbe_detach()



details:   https://anonhg.NetBSD.org/src/rev/8a704d223200
branches:  trunk
changeset: 1023876:8a704d223200
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Sep 30 04:06:50 2021 +0000

description:
Remove vlan_ifdetach() from ixgbe_detach()

The removed function is called in ether_ifdetach().
And ether_ifdetach is changed to be called before a device
is stopped, because vlan_ifdetach called from ether_ifdetach
configures VLAN settings.

diffstat:

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

diffs (57 lines):

diff -r 49eb8a53241b -r 8a704d223200 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Sep 30 04:02:27 2021 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Sep 30 04:06:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.292 2021/09/16 09:55:28 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.293 2021/09/30 04:06:50 yamaguchi Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.292 2021/09/16 09:55:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.293 2021/09/30 04:06:50 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -75,7 +75,6 @@
 #include "ixgbe.h"
 #include "ixgbe_phy.h"
 #include "ixgbe_sriov.h"
-#include "vlan.h"
 
 #include <sys/cprng.h>
 #include <dev/mii/mii.h>
@@ -3668,17 +3667,13 @@
                return (EBUSY);
        }
 
-#if NVLAN > 0
-       /* Make sure VLANs are not using driver */
-       if (!VLAN_ATTACHED(&adapter->osdep.ec))
-               ;       /* nothing to do: no VLANs */
-       else if ((flags & (DETACH_SHUTDOWN | DETACH_FORCE)) != 0)
-               vlan_ifdetach(adapter->ifp);
-       else {
+       if (VLAN_ATTACHED(&adapter->osdep.ec) &&
+           (flags & (DETACH_SHUTDOWN | DETACH_FORCE)) == 0) {
                aprint_error_dev(dev, "VLANs in use, detach first\n");
                return (EBUSY);
        }
-#endif
+
+       ether_ifdetach(adapter->ifp);
 
        adapter->osdep.detaching = true;
        /*
@@ -3699,8 +3694,6 @@
 
        pmf_device_deregister(dev);
 
-       ether_ifdetach(adapter->ifp);
-
        ixgbe_free_deferred_handlers(adapter);
 
        /* let hardware know driver is unloading */



Home | Main Index | Thread Index | Old Index