diff mbox series

realtek: Fix VLAN issues introduced by multicast patches

Message ID 658203b8-b037-3e5e-53f0-66e5d4df9fe0@birger-koblitz.de
State Superseded
Delegated to: Petr Štetiar
Headers show
Series realtek: Fix VLAN issues introduced by multicast patches | expand

Commit Message

Birger Koblitz May 8, 2021, 5:50 p.m. UTC
realtek: Fix VLAN issues introduced by multicast patches

This adds the CPU port to the unknown multicast flooding port mask,
which fixes the VLAN issues introduced by the multicast group patches

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>

---

Comments

John Crispin May 8, 2021, 6:01 p.m. UTC | #1
@bmork, kindly confirm :-)

     John

On 08.05.21 19:50, Birger Koblitz wrote:
> realtek: Fix VLAN issues introduced by multicast patches
>
> This adds the CPU port to the unknown multicast flooding port mask,
> which fixes the VLAN issues introduced by the multicast group patches
>
> Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
>
> ---
>
> diff --git 
> a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c 
> b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
> index 8f66ae6f8f..7c0d55b67a 100644
> --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
> +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
> @@ -501,7 +501,7 @@ static void rtl838x_vlan_profile_setup(int profile)
>          * On RTL93XX, the portmask is directly set in the profile,
>          * see e.g. rtl9300_vlan_profile_setup
>          */
> -       rtl838x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0xfffffff);
> +       rtl838x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x1fffffff);
>  }
>
>  static inline int rtl838x_vlan_port_egr_filter(int port)
> diff --git 
> a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c 
> b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
> index 74472461a1..c62dc441c1 100644
> --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
> +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
> @@ -411,7 +411,7 @@ static void rtl839x_vlan_profile_setup(int profile)
>         sw_w32(p[0], RTL839X_VLAN_PROFILE(profile));
>         sw_w32(p[1], RTL839X_VLAN_PROFILE(profile) + 4);
>
> -       rtl839x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x000fffffffffffff);
> +       rtl839x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x001fffffffffffff);
>  }
>
>  static inline int rtl839x_vlan_port_egr_filter(int port)
> diff --git 
> a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c 
> b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
> index 820c78165a..7ff0001ec7 100644
> --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
> +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
> @@ -153,9 +153,9 @@ static void rtl930x_vlan_profile_setup(int profile)
>
>         // Enable routing of Ipv4/6 Unicast and IPv4/6 Multicast traffic
>         p[0] |= BIT(17) | BIT(16) | BIT(13) | BIT(12);
> -       p[2] = 0x0fffffff; // L2 unknwon MC flooding portmask: all but 
> the CPU-port
> -       p[3] = 0x0fffffff; // IPv4 unknwon MC flooding portmask
> -       p[4] = 0x0fffffff; // IPv6 unknwon MC flooding portmask
> +       p[2] = 0x1fffffff; // L2 unknwon MC flooding portmask all 
> ports, including the CPU-port
> +       p[3] = 0x1fffffff; // IPv4 unknwon MC flooding portmask
> +       p[4] = 0x1fffffff; // IPv6 unknwon MC flooding portmask
>
>         sw_w32(p[0], RTL930X_VLAN_PROFILE_SET(profile));
>         sw_w32(p[1], RTL930X_VLAN_PROFILE_SET(profile) + 4);
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Bjørn Mork May 8, 2021, 6:14 p.m. UTC | #2
John Crispin <john@phrozen.org> writes:

> @bmork, kindly confirm :-)

Works for me on 8380, ignoring whitespace issues. Tested on Netgear
GS108Tv3 with a very basic VLAN config. Cannot say anything about 839x
or 93xx.


Bjørn
Russell Senior May 9, 2021, 7:50 a.m. UTC | #3
I did a buld with the patch applied to commit
e1adb1fa39dd5ef97280ad1b2bb9e8ff4c43674f and it fixes the bug I
reported on my Netgear GS198Tv3.
diff mbox series

Patch

diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
index 8f66ae6f8f..7c0d55b67a 100644
--- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
+++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
@@ -501,7 +501,7 @@  static void rtl838x_vlan_profile_setup(int profile)
          * On RTL93XX, the portmask is directly set in the profile,
          * see e.g. rtl9300_vlan_profile_setup
          */
-       rtl838x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0xfffffff);
+       rtl838x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x1fffffff);
  }

  static inline int rtl838x_vlan_port_egr_filter(int port)
diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
index 74472461a1..c62dc441c1 100644
--- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
+++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
@@ -411,7 +411,7 @@  static void rtl839x_vlan_profile_setup(int profile)
         sw_w32(p[0], RTL839X_VLAN_PROFILE(profile));
         sw_w32(p[1], RTL839X_VLAN_PROFILE(profile) + 4);

-       rtl839x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x000fffffffffffff);
+       rtl839x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x001fffffffffffff);
  }

  static inline int rtl839x_vlan_port_egr_filter(int port)
diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
index 820c78165a..7ff0001ec7 100644
--- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
+++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c
@@ -153,9 +153,9 @@  static void rtl930x_vlan_profile_setup(int profile)

         // Enable routing of Ipv4/6 Unicast and IPv4/6 Multicast traffic
         p[0] |= BIT(17) | BIT(16) | BIT(13) | BIT(12);
-       p[2] = 0x0fffffff; // L2 unknwon MC flooding portmask: all but the CPU-port
-       p[3] = 0x0fffffff; // IPv4 unknwon MC flooding portmask
-       p[4] = 0x0fffffff; // IPv6 unknwon MC flooding portmask
+       p[2] = 0x1fffffff; // L2 unknwon MC flooding portmask all ports, including the CPU-port
+       p[3] = 0x1fffffff; // IPv4 unknwon MC flooding portmask
+       p[4] = 0x1fffffff; // IPv6 unknwon MC flooding portmask

         sw_w32(p[0], RTL930X_VLAN_PROFILE_SET(profile));
         sw_w32(p[1], RTL930X_VLAN_PROFILE_SET(profile) + 4);