summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2025-11-28 09:06:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-18 14:00:04 +0100
commit8e064c3d366703b802f8cbf93aeee3c4fa316d5c (patch)
treef320af9e8fa7356119766d6d97738ca3e2c554d1
parent0978ea24044bc0a6b7e99bf72942625f6cd444ac (diff)
downloadlinux-8e064c3d366703b802f8cbf93aeee3c4fa316d5c.tar.gz
linux-8e064c3d366703b802f8cbf93aeee3c4fa316d5c.tar.bz2
linux-8e064c3d366703b802f8cbf93aeee3c4fa316d5c.zip
net: dsa: b53: fix extracting VID from entry for BCM5325/65
[ Upstream commit 9316012dd01952f75e37035360138ccc786ef727 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/dsa/b53/b53_priv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 458775f95164..2f44b3b6a0d9 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -338,7 +338,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_from_entry(u64 *mac_vid, u32 *fwd_entry,