lkml.org 
[lkml]   [2021]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mt7530 fix mt7530_fdb_write vid missing ivl bit
On Fri, Jul 16, 2021 at 05:36:39PM +0200, ericwouds@gmail.com wrote:
> From: Eric Woudstra <ericwouds@gmail.com>
>
> According to reference guides mt7530 (mt7620) and mt7531:
>
> NOTE: When IVL is reset, MAC[47:0] and FID[2:0] will be used to
> read/write the address table. When IVL is set, MAC[47:0] and CVID[11:0]
> will be used to read/write the address table.
>
> Since the function only fills in CVID and no FID, we need to set the
> IVL bit. The existing code does not set it.
>
> This is a fix for the issue I dropped here earlier:
>
> http://lists.infradead.org/pipermail/linux-mediatek/2021-June/025697.html
>
> With this patch, it is now possible to delete the 'self' fdb entry
> manually. However, wifi roaming still has the same issue, the entry
> does not get deleted automatically. Wifi roaming also needs a fix
> somewhere else to function correctly in combination with vlan.
>
> Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
> ---
> drivers/net/dsa/mt7530.c | 1 +
> drivers/net/dsa/mt7530.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index 93136f7e6..9e4df35f9 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -366,6 +366,7 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
> int i;
>
> reg[1] |= vid & CVID_MASK;
> + reg[1] |= ATA2_IVL;
> reg[2] |= (aging & AGE_TIMER_MASK) << AGE_TIMER;
> reg[2] |= (port_mask & PORT_MAP_MASK) << PORT_MAP;
> /* STATIC_ENT indicate that entry is static wouldn't
> diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
> index 334d610a5..b19b389ff 100644
> --- a/drivers/net/dsa/mt7530.h
> +++ b/drivers/net/dsa/mt7530.h
> @@ -79,6 +79,7 @@ enum mt753x_bpdu_port_fw {
> #define STATIC_EMP 0
> #define STATIC_ENT 3
> #define MT7530_ATA2 0x78
> +#define ATA2_IVL BIT(15)
>
> /* Register for address table write data */
> #define MT7530_ATWD 0x7c
> --
> 2.25.1
>

Can VLAN-unaware FDB entries still be manipulated successfully after
this patch, since it changes 'fid 0' to be interpreted as 'vid 0'?

What is your problem with roaming exactly? Have you tried to disable
hardware address learning on the CPU port and set
ds->assisted_learning_on_cpu_port = true for mt7530?

Please note that since kernel v5.14, raw 'self' entries can no longer be
managed directly using 'bridge fdb', you need to use 'master static' and
go through the bridge:
https://www.kernel.org/doc/html/latest/networking/dsa/configuration.html#forwarding-database-fdb-management
You will need to update your 'bridgefdbd' program, if it proves to be at
all necessary to achieve what you want.

\
 
 \ /
  Last update: 2021-07-16 23:07    [W:0.088 / U:1.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site