[PATCH net v2 1/6] net: stmmac: selftests: Support running selftests on DSA conduits

Nicolai Buchwitz nb at tipi-net.de
Thu Sep 10 11:12:51 PDT 2026


On 10.9.2026 17:13, Maxime Chevallier wrote:
> Most stmmac selftests rely on dev_add_pack() to add custom handlers,
> that validate the packets sent to ourselves through MAC loopback.
> 
> However, when the stmmac-driven interface is a DSA CPU conduit, all
> frames that are received have ETH_P_XDSA as a protocol, even though 
> they
> don't actually contain any tag as they come from the loopback and not
> the switch.
> 
> This will prevent any incoming packet to match our packet handlers.
> 
> Let's register a ETH_P_ALL packet handler when we detect that we're a
> DSA conduit, and use a proxy packet handler to filter the h_proto.
> 
> Note that we may still receive incoming packets from the switch, but
> these frames shouldn't interfere with the very specific frames used for
> selftests, and stmmac selftests in general aren't safe against external
> traffic interferences.
> 
> This was validated on a WPQ864 devkit for IPQ8064, that has the SoC
> connected to a QCA8k switch.
> 
> The ARP offload's packet handler is left alone, this feature is just 
> not
> implemented in stmmac and due for removal.
> 
> Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
> Signed-off-by: Maxime Chevallier <maxime.chevallier at bootlin.com>
> ---

> [...]

Reviewed-by: Nicolai Buchwitz <nb at tipi-net.de>

Thanks,
Nicolai



More information about the linux-arm-kernel mailing list