net: dsa: mt7530: always trap frames to active CPU port on MT7530
authorArınç ÜNAL <arinc.unal@arinc9.com>
Mon, 22 Jan 2024 05:35:52 +0000 (08:35 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Jan 2024 02:04:11 +0000 (18:04 -0800)
commit024d8577f534347b21a33bd098874867bbe50347
tree5c08754223ddadedfc9c0be298a034bffbbb26c6
parent723de3ebef03bc14bd72531f00f9094337654009
net: dsa: mt7530: always trap frames to active CPU port on MT7530

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@gmail.com>
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20240122-for-netnext-mt7530-improvements-1-v3-1-042401f2b279@arinc9.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mt7530.c
drivers/net/dsa/mt7530.h