git: fe6c4e214d76 - main - enic: Don't restart on VLAN changes

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 24 Aug 2023 20:51:59 UTC
The branch main has been updated by kbowling:

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

commit fe6c4e214d76b0e856e5a050abb5420de4f5020b
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2023-08-24 20:29:10 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2023-08-24 20:46:56 +0000

    enic: 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).
    
    MFC after:      2 weeks
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D41558
---
 sys/dev/enic/if_enic.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c
index b2fc3af56006..154eedfd0a19 100644
--- a/sys/dev/enic/if_enic.c
+++ b/sys/dev/enic/if_enic.c
@@ -117,6 +117,7 @@ static int enic_dev_wait(struct vnic_dev *, int (*) (struct vnic_dev *, int),
     int (*) (struct vnic_dev *, int *), int arg);
 static int enic_map_bar(struct enic_softc *, struct enic_bar_info *, int, bool);
 static void enic_update_packet_filter(struct enic *enic);
+static bool enic_if_needs_restart(if_ctx_t, enum iflib_restart_event);
 
 typedef enum {
 	ENIC_BARRIER_RD,
@@ -174,6 +175,8 @@ static device_method_t enic_iflib_methods[] = {
 	DEVMETHOD(ifdi_intr_disable, enic_intr_disable_all),
 	DEVMETHOD(ifdi_msix_intr_assign, enic_msix_intr_assign),
 
+	DEVMETHOD(ifdi_needs_restart, enic_if_needs_restart),
+
 	DEVMETHOD_END
 };
 
@@ -1564,6 +1567,16 @@ enic_update_packet_filter(struct enic *enic)
 	ENIC_UNLOCK(softc);
 }
 
+static bool
+enic_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+	switch (event) {
+	case IFLIB_RESTART_VLAN_CONFIG:
+	default:
+		return (false);
+	}
+}
+
 int
 enic_setup_finish(struct enic *enic)
 {