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.
This commit is contained in:
Tomaz Zaman 2026-03-11 01:19:08 +01:00 • committed by Maurice Walker
parent 24369ce0b4
commit f1e91c63fa

View file

@ -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);