Subject: Re: [PATCH net-next v8 10/10] net: airoha: Support multiple LAN/WAN interfaces for hw MAC address configuration

From: Lorenzo Bianconi <[email-masked]>
Date: Sat, 23 May 2026 10:23:55 +0200

On May 22, Jakub Kicinski wrote:
> On Fri, 22 May 2026 21:25:37 +0200 Lorenzo Bianconi wrote:
> > - What happens when device tree does not provide MAC addresses for two or
> >   more same-side GDM interfaces?
> >   - This is the same comment reported in [0].
> >     Since the hw exposes just a single register (REG_FE_LAN_MAC_H or
> >     REG_FE_WAN_MAC_H) for the LAN/WAN mac address MSBs, we need to
> >     require all the interfaces configured as LAN or WAN to share the
> >     mac address MSBs and the user needs to select the new mac address
> >     observing this limitation.
> >     Please note this limitation is only valid if multiple net_devices
> >     are configured as LAN (or WAN). Since in the current codebase we
> >     do not support multiple interfaces configured as LAN or WAN, we are
> >     not introducing any regression.
> >     I do not think selecting a "base" for the mac address is helpful
> >     if the user does not provide the mac address via the DTS or NVME
> >     (as suggested by sashiko) since it will not help us if the mac
> >     addresses configured via DTS are "wrong" (if they do not respect
> >     the limitation described above).  What do you think?
> 
> If the MACs are not provided something is obviously wrong with the
> device. We should try to provide enough functionality for the user
> to be able to troubleshoot. For an AP perhaps that means SSH / remote
> logs? So switching/routing doesn't have to work, I'd think. 
> 
> Will the user be able to log in when REG_FE_LAN_MAC_H does not match
> the MAC of a port?

REG_FE_LAN_MAC_H and REG_FE_WAN_MAC_H regs are used by the FE module to
hw accelerate forwarded traffic and does not prevent the user to log into
the device even if they are set to a different values with respect to the
configured mac addresses (just hw acceleration will not work properly).
To prove it, I set to 0 REG_FE_WAN_MAC_H, REG_FE_WAN_MAC_LMIN and
REG_FE_WAN_MAC_LMAX and I still able to ping the device via the WAN
interface.
I guess the easiest solution is to neglect errors from airoha_set_macaddr()
in airoha_dev_init() (as it is in the current codebase) in order to allow
the device to probe successfully and provide a warning message to the user
regarding the mac address misconfiguration. What do you think?

Regards,
Lorenzo