From: Anderson Luiz Alves Date: Sun, 12 Aug 2018 12:18:27 +0000 (-0300) Subject: kernel: mv88e6060: disable hardware level MAC learning X-Git-Tag: v19.07.0-rc1~1887 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0c3c944d1eba362fd4f600aaee796de4b77bcaa5;p=oweals%2Fopenwrt.git kernel: mv88e6060: disable hardware level MAC learning Disable Marvell's hardware level MAC learning because it breaks station roaming. When enabled it drops all frames that arrive from a MAC address that is on a different port at learning table. Problem description: Multiple APs with inter-AP roaming connected to different ports, when station moves from one AP on one port to another AP on another port, traffic flow breaks down because the learning table is not updated. Signed-off-by: Anderson Luiz Alves [Replaced with upstream version, move to generic] Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/generic/backport-4.14/424-v4.20-net-dsa-fix-88e6060-roaming.patch b/target/linux/generic/backport-4.14/424-v4.20-net-dsa-fix-88e6060-roaming.patch new file mode 100644 index 0000000000..c49cbe22d1 --- /dev/null +++ b/target/linux/generic/backport-4.14/424-v4.20-net-dsa-fix-88e6060-roaming.patch @@ -0,0 +1,44 @@ +From a74515604a7b171f2702bdcbd1e231225fb456d0 Mon Sep 17 00:00:00 2001 +From: Anderson Luiz Alves +Date: Fri, 30 Nov 2018 21:58:36 -0200 +Subject: [PATCH] mv88e6060: disable hardware level MAC learning + +Disable hardware level MAC learning because it breaks station roaming. +When enabled it drops all frames that arrive from a MAC address +that is on a different port at learning table. + +Signed-off-by: Anderson Luiz Alves +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/mv88e6060.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/net/dsa/mv88e6060.c ++++ b/drivers/net/dsa/mv88e6060.c +@@ -114,8 +114,7 @@ static int mv88e6060_switch_reset(struct + /* Reset the switch. */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, + GLOBAL_ATU_CONTROL_SWRESET | +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + /* Wait up to one second for reset to complete. */ + timeout = jiffies + 1 * HZ; +@@ -140,13 +139,10 @@ static int mv88e6060_setup_global(struct + */ + REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL, GLOBAL_CONTROL_MAX_FRAME_1536); + +- /* Enable automatic address learning, set the address +- * database size to 1024 entries, and set the default aging +- * time to 5 minutes. ++ /* Disable automatic address learning. + */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + return 0; + } diff --git a/target/linux/generic/backport-4.19/424-v4.20-net-dsa-fix-88e6060-roaming.patch b/target/linux/generic/backport-4.19/424-v4.20-net-dsa-fix-88e6060-roaming.patch new file mode 100644 index 0000000000..a242623983 --- /dev/null +++ b/target/linux/generic/backport-4.19/424-v4.20-net-dsa-fix-88e6060-roaming.patch @@ -0,0 +1,44 @@ +From a74515604a7b171f2702bdcbd1e231225fb456d0 Mon Sep 17 00:00:00 2001 +From: Anderson Luiz Alves +Date: Fri, 30 Nov 2018 21:58:36 -0200 +Subject: [PATCH] mv88e6060: disable hardware level MAC learning + +Disable hardware level MAC learning because it breaks station roaming. +When enabled it drops all frames that arrive from a MAC address +that is on a different port at learning table. + +Signed-off-by: Anderson Luiz Alves +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/mv88e6060.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/net/dsa/mv88e6060.c ++++ b/drivers/net/dsa/mv88e6060.c +@@ -116,8 +116,7 @@ static int mv88e6060_switch_reset(struct + /* Reset the switch. */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, + GLOBAL_ATU_CONTROL_SWRESET | +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + /* Wait up to one second for reset to complete. */ + timeout = jiffies + 1 * HZ; +@@ -142,13 +141,10 @@ static int mv88e6060_setup_global(struct + */ + REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL, GLOBAL_CONTROL_MAX_FRAME_1536); + +- /* Enable automatic address learning, set the address +- * database size to 1024 entries, and set the default aging +- * time to 5 minutes. ++ /* Disable automatic address learning. + */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + return 0; + } diff --git a/target/linux/generic/backport-4.9/424-v4.20-net-dsa-fix-88e6060-roaming.patch b/target/linux/generic/backport-4.9/424-v4.20-net-dsa-fix-88e6060-roaming.patch new file mode 100644 index 0000000000..c49cbe22d1 --- /dev/null +++ b/target/linux/generic/backport-4.9/424-v4.20-net-dsa-fix-88e6060-roaming.patch @@ -0,0 +1,44 @@ +From a74515604a7b171f2702bdcbd1e231225fb456d0 Mon Sep 17 00:00:00 2001 +From: Anderson Luiz Alves +Date: Fri, 30 Nov 2018 21:58:36 -0200 +Subject: [PATCH] mv88e6060: disable hardware level MAC learning + +Disable hardware level MAC learning because it breaks station roaming. +When enabled it drops all frames that arrive from a MAC address +that is on a different port at learning table. + +Signed-off-by: Anderson Luiz Alves +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/dsa/mv88e6060.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/net/dsa/mv88e6060.c ++++ b/drivers/net/dsa/mv88e6060.c +@@ -114,8 +114,7 @@ static int mv88e6060_switch_reset(struct + /* Reset the switch. */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, + GLOBAL_ATU_CONTROL_SWRESET | +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + /* Wait up to one second for reset to complete. */ + timeout = jiffies + 1 * HZ; +@@ -140,13 +139,10 @@ static int mv88e6060_setup_global(struct + */ + REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL, GLOBAL_CONTROL_MAX_FRAME_1536); + +- /* Enable automatic address learning, set the address +- * database size to 1024 entries, and set the default aging +- * time to 5 minutes. ++ /* Disable automatic address learning. + */ + REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL, +- GLOBAL_ATU_CONTROL_ATUSIZE_1024 | +- GLOBAL_ATU_CONTROL_ATE_AGE_5MIN); ++ GLOBAL_ATU_CONTROL_LEARNDIS); + + return 0; + }