Module Name: src
Committed By: yamaguchi
Date: Thu Sep 30 04:06:50 UTC 2021
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.292 -r1.293 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.292 src/sys/dev/pci/ixgbe/ixgbe.c:1.293
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.292 Thu Sep 16 09:55:28 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c Thu Sep 30 04:06:50 2021
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.
#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 @@ ixgbe_detach(device_t dev, int flags)
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 @@ ixgbe_detach(device_t dev, int flags)
pmf_device_deregister(dev);
- ether_ifdetach(adapter->ifp);
-
ixgbe_free_deferred_handlers(adapter);
/* let hardware know driver is unloading */