54db56df21938e7347a83033d23d663bb82a4abf
[openwrt/staging/xback.git] /
1 From 2bed2d0932c37d6cae9a745613c2e8f83649ed39 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Tue, 25 Nov 2025 08:51:45 +0100
4 Subject: [PATCH] net: dsa: b53: fix extracting VID from entry for BCM5325/65
5
6 BCM5325/65's Entry register uses the highest three bits for
7 VALID/STATIC/AGE, so shifting by 53 only will add these to
8 b53_arl_entry::vid.
9
10 So make sure to mask the vid value as well, to not get invalid VIDs.
11
12 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
13 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
14 ---
15 drivers/net/dsa/b53/b53_priv.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/drivers/net/dsa/b53/b53_priv.h
19 +++ b/drivers/net/dsa/b53/b53_priv.h
20 @@ -350,7 +350,7 @@ static inline void b53_arl_to_entry_25(s
21 ent->is_age = !!(mac_vid & ARLTBL_AGE_25);
22 ent->is_static = !!(mac_vid & ARLTBL_STATIC_25);
23 u64_to_ether_addr(mac_vid, ent->mac);
24 - ent->vid = mac_vid >> ARLTBL_VID_S_65;
25 + ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
26 }
27
28 static inline void b53_arl_to_entry_89(struct b53_arl_entry *ent,