Skip to content

Commit 8513210

Browse files
KanjiMonsterkuba-moo
authored andcommitted
net: dsa: b53: fix CPU port unicast ARL entries for BCM5325/65
On BCM5325 and BCM5365, unicast ARL entries use 8 as the value for the CPU port, so we need to translate it to/from 5 as used for the CPU port at most other places. Fixes: c456553 ("net: dsa: b53: add support for FDB operations on 5325/5365") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20251128080625.27181-5-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8e46aac commit 8513210

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/net/dsa/b53/b53_priv.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,14 @@ static inline void b53_arl_to_entry_25(struct b53_arl_entry *ent,
344344
u64 mac_vid)
345345
{
346346
memset(ent, 0, sizeof(*ent));
347-
ent->port = (mac_vid >> ARLTBL_DATA_PORT_ID_S_25) &
348-
ARLTBL_DATA_PORT_ID_MASK_25;
349347
ent->is_valid = !!(mac_vid & ARLTBL_VALID_25);
350348
ent->is_age = !!(mac_vid & ARLTBL_AGE_25);
351349
ent->is_static = !!(mac_vid & ARLTBL_STATIC_25);
352350
u64_to_ether_addr(mac_vid, ent->mac);
351+
ent->port = (mac_vid >> ARLTBL_DATA_PORT_ID_S_25) &
352+
ARLTBL_DATA_PORT_ID_MASK_25;
353+
if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
354+
ent->port = B53_CPU_PORT_25;
353355
ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
354356
}
355357

@@ -383,8 +385,11 @@ static inline void b53_arl_from_entry_25(u64 *mac_vid,
383385
const struct b53_arl_entry *ent)
384386
{
385387
*mac_vid = ether_addr_to_u64(ent->mac);
386-
*mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
387-
ARLTBL_DATA_PORT_ID_S_25;
388+
if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
389+
*mac_vid |= (u64)B53_CPU_PORT << ARLTBL_DATA_PORT_ID_S_25;
390+
else
391+
*mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
392+
ARLTBL_DATA_PORT_ID_S_25;
388393
*mac_vid |= (u64)(ent->vid & ARLTBL_VID_MASK_25) <<
389394
ARLTBL_VID_S_65;
390395
if (ent->is_valid)

0 commit comments

Comments
 (0)