Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2023 22:35:40 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 5c4f04ff008c - stable/13 - vmxnet3: do restart on VLAN changes
Message-ID:  <202309112235.38BMZeDZ057022@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=5c4f04ff008ca920219655e401fef48a5806f77d

commit 5c4f04ff008ca920219655e401fef48a5806f77d
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2023-08-24 20:25:21 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2023-09-11 22:34:21 +0000

    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)
---
 sys/dev/vmware/vmxnet3/if_vmx.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309112235.38BMZeDZ057022>