1 From d0d7daf6e051f8795e4e1b759ff5055c80a85832 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Tue, 25 Nov 2025 08:51:47 +0100
4 Subject: [PATCH] net: dsa: b53: fix CPU port unicast ARL entries for BCM5325/65
6 On BCM5325 and BCM5365, unicast ARL entries use 8 as the value for the
7 CPU port, so we need to translate it to/from 5 as used for the CPU port
10 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
11 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
13 drivers/net/dsa/b53/b53_priv.h | 13 +++++++++----
14 1 file changed, 9 insertions(+), 4 deletions(-)
16 --- a/drivers/net/dsa/b53/b53_priv.h
17 +++ b/drivers/net/dsa/b53/b53_priv.h
18 @@ -344,12 +344,14 @@ static inline void b53_arl_to_entry_25(s
21 memset(ent, 0, sizeof(*ent));
22 - ent->port = (mac_vid >> ARLTBL_DATA_PORT_ID_S_25) &
23 - ARLTBL_DATA_PORT_ID_MASK_25;
24 ent->is_valid = !!(mac_vid & ARLTBL_VALID_25);
25 ent->is_age = !!(mac_vid & ARLTBL_AGE_25);
26 ent->is_static = !!(mac_vid & ARLTBL_STATIC_25);
27 u64_to_ether_addr(mac_vid, ent->mac);
28 + ent->port = (mac_vid >> ARLTBL_DATA_PORT_ID_S_25) &
29 + ARLTBL_DATA_PORT_ID_MASK_25;
30 + if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
31 + ent->port = B53_CPU_PORT_25;
32 ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
35 @@ -383,8 +385,11 @@ static inline void b53_arl_from_entry_25
36 const struct b53_arl_entry *ent)
38 *mac_vid = ether_addr_to_u64(ent->mac);
39 - *mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
40 - ARLTBL_DATA_PORT_ID_S_25;
41 + if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
42 + *mac_vid |= (u64)B53_CPU_PORT << ARLTBL_DATA_PORT_ID_S_25;
44 + *mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
45 + ARLTBL_DATA_PORT_ID_S_25;
46 *mac_vid |= (u64)(ent->vid & ARLTBL_VID_MASK_25) <<