Re: [PATCH net] net: renesas: rswitch: fix forwarding offload statemachine
From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-02-06 15:55:40
Also in:
linux-renesas-soc, lkml
On Fri, Feb 06, 2026 at 11:34:24AM +0100, Nikita Yushchenko wrote:
quoted
Unfortunately, your argumentation is very _academic_. There is _no_practical_reason_, not to forward the traffic to the SW bridge via the HW bridge, even if only one link is currently up.The very practical reason not to forward packet to SW when it can be handled in HW is - reduce SW load. SW cores have no chance to handle the load if you forward everything to SW at the channel speed. The very thing I was trying to achieve when working on this offload support was - detect the case when a frame can be processed correctly in HW, and let it process it in HW, without notifying SW. And send frame to SW if and only if it is not possible to provide correct processing without that. But this does not directly affect the case being discussed. When there is only one port with enabled HW forwarding, there is no effect of keeping HW forwarding enabled, because the allowed destination mask computed nearby does not contain any destinations. Forwarding to CPU port was never handled via L2 forwarding (*), because L2 forwarding on rswitch requires explicit adding any possible destination MAC to the L2 table -
Are you saying this switch does not do address learning? In general, or just not for the CPU port? DSA switches handle the CPU port in a few different ways: * They do address learning, so learn what MAC addresses are in the direction of the CPU from the traffic sent by the CPU. * All frames with a destination MAC address not in the address translation unit get sent to the CPU. This is sometimes implicit, the CPU is included in the flood for unknown MAC addresses, or there is an explicit bit to enable this. The software bridge will then handle the frame. The reply, if there is one, should then trigger address learning. * The switch driver taps into the events the software bridge issues as it does address learning. This allows the switch to setup its address translation tables to mirror the software switch. The overall result is that having just one switch port in the bridge is no different to having multiple switch ports in the bridge. Andrew