From f1e91c63fafecbba81964f4bf482475b78ed7da4 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Wed, 11 Mar 2026 01:19:08 +0100 Subject: [PATCH] dpaa: start MII tick for LAGG member ports, reprogram MAC on enable LAGG member ports are enabled via SIOCSIFFLAGS -> dtsec_if_enable_locked(), not dtsec_if_init_locked(). The MII tick callout was only started in the init path, so LAGG member ports never got periodic PHY polling. Without the tick, link state changes (cable unplug/replug) were never detected and RTM_IFINFO was never generated. Start callout_reset in dtsec_if_enable_locked() so member ports get the same periodic PHY polling as standalone ports. Also reprogram the hardware MAC address via FM_MAC_ModifyMacAddr() since LAGG changes the stack MAC via if_setlladdr() then cycles SIOCSIFFLAGS. --- sys/dev/dpaa/if_dtsec.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c index e98e2321f3e..11b81b8265a 100644 --- a/sys/dev/dpaa/if_dtsec.c +++ b/sys/dev/dpaa/if_dtsec.c @@ -411,6 +411,8 @@ dtsec_setup_multicast(struct dtsec_softc *sc) if_foreach_llmaddr(sc->sc_ifnet, dtsec_hash_maddr, sc); } +static void dtsec_if_tick(void *arg); + static int dtsec_if_enable_locked(struct dtsec_softc *sc) { @@ -430,10 +432,27 @@ dtsec_if_enable_locked(struct dtsec_softc *sc) if (error != E_OK) return (EIO); + /* Reprogram hardware MAC address from current stack address. + * LAGG changes the stack MAC via if_setlladdr() then cycles + * SIOCSIFFLAGS, which reaches here — not dtsec_if_init_locked(). + * Safe to call unconditionally; no-op if address hasn't changed. */ + error = FM_MAC_ModifyMacAddr(sc->sc_mach, + (t_EnetAddr *)if_getlladdr(sc->sc_ifnet)); + if (error != E_OK) + return (EIO); + dtsec_setup_multicast(sc); if_setdrvflagbits(sc->sc_ifnet, IFF_DRV_RUNNING, 0); + /* Start MII tick if not already running. + * dtsec_if_init_locked() starts this, but LAGG member ports + * are enabled via SIOCSIFFLAGS → dtsec_if_enable_locked() + * without going through if_init(), so the tick never starts. + * callout_reset is idempotent — safe to call if already running. */ + if (sc->sc_mii != NULL) + callout_reset(&sc->sc_tick_callout, hz, dtsec_if_tick, sc); + /* Refresh link state */ dtsec_miibus_statchg(sc->sc_dev);