aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2023-08-24 20:25:21 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2023-09-11 22:34:21 +0000
commit5c4f04ff008ca920219655e401fef48a5806f77d (patch)
tree202adcf9ca73ae3e1dec2bb80134a5a5306d9840
parent6cb4a544e00f834d3fa956aca61b0f71c04a4ad5 (diff)
downloadsrc-5c4f04ff008ca920219655e401fef48a5806f77d.tar.gz
src-5c4f04ff008ca920219655e401fef48a5806f77d.zip
vmxnet3: do restart on VLAN changes
vmxnet3: Don't restart on VLAN changes In rS360398, a new iflib device method was added with default of opt out for VLAN events needing an interface reset. This re-init is unintentional for vmxnet3(4). Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558 (cherry picked from commit b6b75424c57d6da49967fef39f69080ce6939207) vmxnet3: do restart on VLAN changes At least one user reports issues with vmx interfaces after 725e4008ef, where we default to not resetting the interface on VLAN changes. This was on an ESXi 7.0.3 setup. Reported by: Marcos Mendoza <mmendoza@netgate.com> Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 8c1274138a20ee2342c4f217adb605e3abc14042)
-rw-r--r--sys/dev/vmware/vmxnet3/if_vmx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c
index adf69c320281..cd313b5b8084 100644
--- a/sys/dev/vmware/vmxnet3/if_vmx.c
+++ b/sys/dev/vmware/vmxnet3/if_vmx.c
@@ -180,6 +180,7 @@ static void vmxnet3_enable_intr(struct vmxnet3_softc *, int);
static void vmxnet3_disable_intr(struct vmxnet3_softc *, int);
static void vmxnet3_intr_enable_all(if_ctx_t);
static void vmxnet3_intr_disable_all(if_ctx_t);
+static bool vmxnet3_if_needs_restart(if_ctx_t, enum iflib_restart_event);
typedef enum {
VMXNET3_BARRIER_RD,
@@ -248,6 +249,8 @@ static device_method_t vmxnet3_iflib_methods[] = {
DEVMETHOD(ifdi_suspend, vmxnet3_suspend),
DEVMETHOD(ifdi_resume, vmxnet3_resume),
+ DEVMETHOD(ifdi_needs_restart, vmxnet3_if_needs_restart),
+
DEVMETHOD_END
};
@@ -2516,6 +2519,17 @@ vmxnet3_intr_disable_all(if_ctx_t ctx)
vmxnet3_disable_intr(sc, i);
}
+static bool
+vmxnet3_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ return (true);
+ default:
+ return (false);
+ }
+}
+
/*
* Since this is a purely paravirtualized device, we do not have
* to worry about DMA coherency. But at times, we must make sure