]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: dsa: b53: fix extracting VID from entry for BCM5325/65
authorJonas Gorski <jonas.gorski@gmail.com>
Fri, 28 Nov 2025 08:06:20 +0000 (09:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 1 Dec 2025 22:46:39 +0000 (14:46 -0800)
BCM5325/65's Entry register uses the highest three bits for
VALID/STATIC/AGE, so shifting by 53 only will add these to
b53_arl_entry::vid.

So make sure to mask the vid value as well, to not get invalid VIDs.

Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://patch.msgid.link/20251128080625.27181-3-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_priv.h

index 2bfd0e7c95c9868c8a74146afbce030c5bb162b7..3b22e817fb288b0294927cb2202d109ceff7e44b 100644 (file)
@@ -350,7 +350,7 @@ static inline void b53_arl_to_entry_25(struct b53_arl_entry *ent,
        ent->is_age = !!(mac_vid & ARLTBL_AGE_25);
        ent->is_static = !!(mac_vid & ARLTBL_STATIC_25);
        u64_to_ether_addr(mac_vid, ent->mac);
-       ent->vid = mac_vid >> ARLTBL_VID_S_65;
+       ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
 }
 
 static inline void b53_arl_to_entry_89(struct b53_arl_entry *ent,