git: f9e0a790ae44 - main - enetc: Don't restart on VLAN changes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 24 Aug 2023 20:51:57 UTC
The branch main has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=f9e0a790ae441f649cc9ff2538dc3a2b2a0a0cb4
commit f9e0a790ae441f649cc9ff2538dc3a2b2a0a0cb4
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2023-08-24 20:24:48 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2023-08-24 20:46:56 +0000
enetc: 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 enetc(4).
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558
---
sys/dev/enetc/if_enetc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c
index 04171698cd38..ec703c09ba77 100644
--- a/sys/dev/enetc/if_enetc.c
+++ b/sys/dev/enetc/if_enetc.c
@@ -96,6 +96,7 @@ static int enetc_mtu_set(if_ctx_t, uint32_t);
static void enetc_setup_multicast(if_ctx_t);
static void enetc_timer(if_ctx_t, uint16_t);
static void enetc_update_admin_status(if_ctx_t);
+static bool enetc_if_needs_restart(if_ctx_t, enum iflib_restart_event);
static miibus_readreg_t enetc_miibus_readreg;
static miibus_writereg_t enetc_miibus_writereg;
@@ -202,6 +203,8 @@ static device_method_t enetc_iflib_methods[] = {
DEVMETHOD(ifdi_timer, enetc_timer),
DEVMETHOD(ifdi_update_admin_status, enetc_update_admin_status),
+ DEVMETHOD(ifdi_needs_restart, enetc_if_needs_restart),
+
DEVMETHOD_END
};
@@ -1410,6 +1413,16 @@ enetc_update_admin_status(if_ctx_t ctx)
}
}
+static bool
+enetc_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ default:
+ return (false);
+ }
+}
+
static int
enetc_miibus_readreg(device_t dev, int phy, int reg)
{