04.07.2025 19:53, Andrew Lunn wrote:
On Fri, Jul 04, 2025 at 11:05:14AM +0200, Nikita Yushchenko wrote:
Looking at the code, it is not clear to me what would happen with:
ip link add name br0 type bridge
ip link set dev tsn0 master br0
ip link set dev br0 up
ip link set dev tsn0 up
ip link add name br1 type bridge
ip link set dev tsn1 master br1
ip link set dev br1 up
ip link set dev tsn1 up
Per design, it shall enable hardware forwarding when two ports are in the same brdev.
So in this case, the hardware offload has been reserved by br0, but is
in fact never used, since there is only one port in the bridge. If i
was to then do
ip link set dev tsn2 master br1
ip link set dev tsn2 up
br1 would not be offloaded, but done in software.
rswitch_update_offload_brdev() calculates which brdev to offload, and it only considers brdev having at
least two rswitch ports. So in this case br1 shall get offloaded.
Nikita