mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-09 14:12:10 -05:00
realtek: rtl930x: Disable L3 offloading
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>
This commit is contained in:
parent
5faf91ab8d
commit
843e8a47e2
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user