Re: [PATCH net-next v3 1/7] net: dsa: mt7530: always trap frames to active CPU port on MT7530

From: Vladimir Oltean
Date: Thu Jan 25 2024 - 04:33:22 EST


On Mon, Jan 22, 2024 at 08:35:52AM +0300, Arınç ÜNAL via B4 Relay wrote:
> From: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
>
> On the MT7530 switch, the CPU_PORT field indicates which CPU port to trap
> frames to, regardless of the affinity of the inbound user port.
>
> When multiple CPU ports are in use, if the DSA conduit interface is down,
> trapped frames won't be passed to the conduit interface.
>
> To make trapping frames work including this case, implement
> ds->ops->conduit_state_change() on this subdriver and set the CPU_PORT
> field to the numerically smallest CPU port whose conduit interface is up.
> Introduce the active_cpu_ports field to store the information of the active
> CPU ports. Correct the macros, CPU_PORT is bits 4 through 6 of the
> register.
>
> Add a comment to explain frame trapping for this switch.
>
> Currently, the driver doesn't support the use of multiple CPU ports so this
> is not necessarily a bug fix.
>
> Suggested-by: Vladimir Oltean <olteanv@xxxxxxxxx>
> Suggested-by: Russell King (Oracle) <linux@xxxxxxxxxxxxxxx>
> Signed-off-by: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
> ---

Reviewed-by: Vladimir Oltean <olteanv@xxxxxxxxx>