Re: [PATCH 2/3] net: renesas: rswitch: add offloading for L2 switching

From: Nikita Yushchenko
Date: Fri Jul 04 2025 - 05:08:13 EST


struct phy *serdes;
+
+ struct net_device *brdev; /* master bridge device */

How many ports does this device have? If it is just two, this might
work. But for a multi-port device, you need to keep this in the port
structure.

Having per-device (not per port) brdev was designed by me. Reasoning is that hw L2 forwarding support lacks any sort of source port based filtering, which makes it unusable to offload more than one bridge device. Either you allow hardware to forward destination MAC to a port, or you have to send it to CPU. You can't make it forward only if src and dst ports are in the same brdev.

There are 3 ports in the S4 SoC, but the rswitch IP is parametrized so any number of ports could be possible. And, we have been implementing virtual ports (not yet in the patchset by Michael) which opened possibility to have netdevs of the same rswitch to be in multiple brdevs even on S4. But still had to limit to one brdev due to that hw limitation.

There could be a theoretical possibility to use hw L3 forwarding features for better L2 forwarding, but that is tricky and creating such a design did not succeed so far.

Nikita