]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl930x: Disable L3 offloading 20208/head
authorHarshal Gohel <hg@simonwunderlich.de>
Tue, 15 Jul 2025 18:20:00 +0000 (20:20 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 21 Oct 2025 19:59:28 +0000 (21:59 +0200)
L3 Offloading caused DHCP packets to be dropped at hardware level
And potentially buggy route implementation can cause a crash

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20208
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/Kconfig
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
target/linux/realtek/rtl838x/config-6.12
target/linux/realtek/rtl839x/config-6.12
target/linux/realtek/rtl930x/config-6.12
target/linux/realtek/rtl930x_nand/config-6.12
target/linux/realtek/rtl931x/config-6.12
target/linux/realtek/rtl931x_nand/config-6.12

index 0af4abcfb9cbd26f96df82196f54cf44f14415dd..97e6c8f428a86df1d818c9b319380437d4b82c00 100644 (file)
@@ -5,3 +5,7 @@ config NET_DSA_RTL83XX
        select NET_DSA_TAG_TRAILER
        help
          This driver adds support for Realtek RTL83xx series switching.
+
+config NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
+       bool "Realtek RTL930x layer 3 offload (experimental)"
+       depends on NET_DSA_RTL83XX
index ead7dc4008d99db5e81e693e75297dc7c46c2c39..0f29e2f9cd7f5e99320d1fc499c2c80469c27a28 100644 (file)
@@ -907,6 +907,9 @@ static void rtl930x_init_eee(struct rtl838x_switch_priv *priv, bool enable)
 
        priv->eee_enabled = enable;
 }
+
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
+
 #define HASH_PICK(val, lsb, len)   ((val & (((1 << len) - 1) << lsb)) >> lsb)
 
 static u32 rtl930x_l3_hash4(u32 ip, int algorithm, bool move_dip)
@@ -1460,6 +1463,8 @@ static void rtl930x_set_l3_nexthop(int idx, u16 dmac_id, u16 interface)
        rtl_table_release(r);
 }
 
+#endif /* CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD */
+
 static void rtl930x_pie_lookup_enable(struct rtl838x_switch_priv *priv, int index)
 {
        int block = index / PIE_BLOCK_SIZE;
@@ -1987,6 +1992,8 @@ static void rtl930x_pie_init(struct rtl838x_switch_priv *priv)
 
 }
 
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
+
 /* Sets up an egress interface for L3 actions
  * Actions for ip4/6_icmp_redirect, ip4/6_pbr_icmp_redirect are:
  * 0: FORWARD, 1: DROP, 2: TRAP2CPU, 3: COPY2CPU, 4: TRAP2MASTERCPU 5: COPY2MASTERCPU
@@ -2193,6 +2200,8 @@ static int rtl930x_l3_setup(struct rtl838x_switch_priv *priv)
        return 0;
 }
 
+#endif /* CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD */
+
 static u32 rtl930x_packet_cntr_read(int counter)
 {
        u32 v;
@@ -2508,6 +2517,7 @@ const struct rtl838x_reg rtl930x_reg = {
        .l2_learning_setup = rtl930x_l2_learning_setup,
        .packet_cntr_read = rtl930x_packet_cntr_read,
        .packet_cntr_clear = rtl930x_packet_cntr_clear,
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
        .route_read = rtl930x_route_read,
        .route_write = rtl930x_route_write,
        .host_route_write = rtl930x_host_route_write,
@@ -2521,6 +2531,7 @@ const struct rtl838x_reg rtl930x_reg = {
        .get_l3_router_mac = rtl930x_get_l3_router_mac,
        .set_l3_router_mac = rtl930x_set_l3_router_mac,
        .set_l3_egress_intf = rtl930x_set_l3_egress_intf,
+#endif
        .set_distribution_algorithm = rtl930x_set_distribution_algorithm,
        .led_init = rtl930x_led_init,
        .enable_learning = rtldsa_930x_enable_learning,
index ef2f183fc36ba95926142b78e8eb1f7879acd5fe..11e0991ad9a543480d59dec230bc3c8a8346cf74 100644 (file)
@@ -173,6 +173,7 @@ CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_INGRESS=y
index 26e8c2bb57720ee4b18ddce9d03034fdf5c1d193..684ba5e590aaec9c0f91fcd9f6859d3c9376d7bf 100644 (file)
@@ -176,6 +176,7 @@ CONFIG_NEED_SRCU_NMI_SAFE=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_FLOW_LIMIT=y
index 4da9fe4bca1c7c61de802748fc8a454112e5cd42..df36dfb1194023eb61641afb30b7d1a5e55823ce 100644 (file)
@@ -158,6 +158,7 @@ CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_FLOW_LIMIT=y
index b38391cf609c19ef86bfc51162c41f93ef92f811..61a4457d37b57042f86db3c564347d297bf06f58 100644 (file)
@@ -165,6 +165,7 @@ CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_FLOW_LIMIT=y
index 6d402df03bdfa6ed294c2f34ef8074558e46dd76..efd794258b66fd8eff3a2521d51b82cc71b74bf3 100644 (file)
@@ -169,6 +169,7 @@ CONFIG_NEED_SRCU_NMI_SAFE=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_FLOW_LIMIT=y
index f77267c816b277119aad566b78b44a2cff966cec..9864c2d9ed4c00c7347e7959fdc709933418e05c 100644 (file)
@@ -176,6 +176,7 @@ CONFIG_NEED_SRCU_NMI_SAFE=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
 CONFIG_NET_DSA_RTL83XX=y
+# CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD is not set
 CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_EGRESS=y
 CONFIG_NET_FLOW_LIMIT=y