kernel: backport b53/bcm_sf2 changes from v5.7
[openwrt/staging/hauke.git] / target / linux / generic / backport-5.4 / 707-v5.7-0007-net-dsa-b53-Deny-enslaving-port-7-for-7278-into-a-br.patch
1 From 31bfc2d42cae6e8b1440fc5db3f0aba6c5d7e602 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <f.fainelli@gmail.com>
3 Date: Mon, 30 Mar 2020 14:38:49 -0700
4 Subject: [PATCH] net: dsa: b53: Deny enslaving port 7 for 7278 into a bridge
5
6 On 7278, port 7 connects to the ASP which should only receive frames
7 through the use of CFP rules, it is not desirable to have it be part of
8 a bridge at all since that would make it pick up unwanted traffic that
9 it may not even be able to filter or sustain.
10
11 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/dsa/b53/b53_common.c | 6 ++++++
15 1 file changed, 6 insertions(+)
16
17 --- a/drivers/net/dsa/b53/b53_common.c
18 +++ b/drivers/net/dsa/b53/b53_common.c
19 @@ -1770,6 +1770,12 @@ int b53_br_join(struct dsa_switch *ds, i
20 u16 pvlan, reg;
21 unsigned int i;
22
23 + /* On 7278, port 7 which connects to the ASP should only receive
24 + * traffic from matching CFP rules.
25 + */
26 + if (dev->chip_id == BCM7278_DEVICE_ID && port == 7)
27 + return -EINVAL;
28 +
29 /* Make this port leave the all VLANs join since we will have proper
30 * VLAN entries from now on
31 */