2022-03-20 06:43:20

by Tobias Waldekranz

[permalink] [raw]
Subject: [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes

1/2 fixes the issue reported by Marek here:

https://lore.kernel.org/netdev/20220318182817.5ade8ecd@dellmb/

2/2 adds a missing capability check to the new .vlan_msti_set
callback.

Tobias Waldekranz (2):
net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback

drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
drivers/net/dsa/mv88e6xxx/chip.h | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)

--
2.25.1


2022-03-21 15:36:28

by Tobias Waldekranz

[permalink] [raw]
Subject: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback

In the same way that we check for STU support in the MST state
callback, we should also verify it before trying to change a VLANs
MSTI membership.

Fixes: acaf4d2e36b3 ("net: dsa: mv88e6xxx: MST Offloading")
Signed-off-by: Tobias Waldekranz <[email protected]>
---
drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index b36393ba6d49..afb9417ffca0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2678,6 +2678,9 @@ static int mv88e6xxx_vlan_msti_set(struct dsa_switch *ds,
u8 old_sid, new_sid;
int err;

+ if (!mv88e6xxx_has_stu(chip))
+ return -EOPNOTSUPP;
+
mv88e6xxx_reg_lock(chip);

err = mv88e6xxx_vtu_get(chip, msti->vid, &vlan);
--
2.25.1

2022-03-21 19:03:29

by Tobias Waldekranz

[permalink] [raw]
Subject: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support

Simply having a physical STU table in the device doesn't do us any
good if there's no implementation of the relevant ops to access that
table. So ensure that chips that claim STU support can also talk to
the hardware.

This fixes an issue where chips that had a their ->info->max_sid
set (due to their family membership), but no implementation (due to
their chip-specific ops struct) would fail to probe.

Fixes: 49c98c1dc7d9 ("net: dsa: mv88e6xxx: Disentangle STU from VTU")
Reported-by: Marek BehĂșn <[email protected]>
Signed-off-by: Tobias Waldekranz <[email protected]>
---
drivers/net/dsa/mv88e6xxx/chip.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index 6a0b66354e1d..5e03cfe50156 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -730,7 +730,9 @@ struct mv88e6xxx_hw_stat {

static inline bool mv88e6xxx_has_stu(struct mv88e6xxx_chip *chip)
{
- return chip->info->max_sid > 0;
+ return chip->info->max_sid > 0 &&
+ chip->info->ops->stu_loadpurge &&
+ chip->info->ops->stu_getnext;
}

static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)
--
2.25.1

2022-03-21 23:49:16

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <[email protected]>:

On Fri, 18 Mar 2022 21:13:19 +0100 you wrote:
> 1/2 fixes the issue reported by Marek here:
>
> https://lore.kernel.org/netdev/20220318182817.5ade8ecd@dellmb/
>
> 2/2 adds a missing capability check to the new .vlan_msti_set
> callback.
>
> [...]

Here is the summary with links:
- [net-next,1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
https://git.kernel.org/netdev/net-next/c/afaed2b142a1
- [net-next,2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
https://git.kernel.org/netdev/net-next/c/bd48b911c88f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html