Re: [PATCH net 1/6] net: dsa: ksz: fix FID management

2021-01-13 Thread Gilles Doffe
- Le 13 Jan 21, à 13:45, Gilles Doffe gilles.do...@savoirfairelinux.com a écrit : > The FID (Filter ID) is a 7 bits field used to link the VLAN table > to the static and dynamic mac address tables. > Until now the KSZ8795 driver could only add one VLAN as the FID was > alw

[PATCH net 0/6] Fixes on Microchip KSZ8795 DSA switch driver

2021-01-13 Thread Gilles DOFFE
This patchset fixes various issues. It mainly concerns VLANs support by fixing FID table management to allow adding more than one VLAN. It also fixes tag/untag behavior on ingress/egress packets. Gilles DOFFE (6): net: dsa: ksz: fix FID management net: dsa: ksz: move tag/untag action net

[PATCH net 4/6] net: dsa: ksz: do not change tagging on del

2021-01-13 Thread Gilles DOFFE
If a VLAN is removed, the tagging policy should not be changed as still active VLANs could be impacted. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip

[PATCH net 1/6] net: dsa: ksz: fix FID management

2021-01-13 Thread Gilles DOFFE
. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 59 +++-- drivers/net/dsa/microchip/ksz8795_reg.h | 1 + drivers/net/dsa/microchip/ksz_common.h | 1 + 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/microchip

[PATCH net 6/6] net: dsa: ksz: fix wrong read cast to u64

2021-01-13 Thread Gilles DOFFE
'(u64)*value' casts a u32 to a u64. So depending on endianness, LSB or MSB is lost. The pointer needs to be cast to read the full u64: '*((u64 *)value)' Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz_common.h | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH net 2/6] net: dsa: ksz: move tag/untag action

2021-01-13 Thread Gilles DOFFE
Move tag/untag action at the end of the function to avoid tagging or untagging traffic if only vlan 0 is handled. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b

[PATCH net 3/6] net: dsa: ksz: insert tag on ks8795 ingress packets

2021-01-13 Thread Gilles DOFFE
If 802.1q VLAN tag is removed from egress traffic, ingress traffic should by logic be tagged. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index

[PATCH net 5/6] net: dsa: ksz: fix wrong pvid

2021-01-13 Thread Gilles DOFFE
A logical 'or' was performed until now. So if vlan 1 is the current pvid and vlan 20 is set as the new one, vlan 21 is the new pvid. This commit fixes this by setting the right mask to set the new pvid. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 4 ++-- 1 fi