All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes
@ 2022-03-18 20:13 Tobias Waldekranz
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tobias Waldekranz @ 2022-03-18 20:13 UTC (permalink / raw)
  To: davem, kuba
  Cc: Marek Behun, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, Paolo Abeni, netdev, linux-kernel

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
  2022-03-18 20:13 [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes Tobias Waldekranz
@ 2022-03-18 20:13 ` Tobias Waldekranz
  2022-03-18 20:40   ` Vladimir Oltean
                     ` (2 more replies)
  2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
  2022-03-21 23:00 ` [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes patchwork-bot+netdevbpf
  2 siblings, 3 replies; 10+ messages in thread
From: Tobias Waldekranz @ 2022-03-18 20:13 UTC (permalink / raw)
  To: davem, kuba
  Cc: Marek Behún, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, Paolo Abeni, netdev, linux-kernel

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 <kabel@kernel.org>
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
  2022-03-18 20:13 [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes Tobias Waldekranz
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
@ 2022-03-18 20:13 ` Tobias Waldekranz
  2022-03-18 20:41   ` Vladimir Oltean
                     ` (2 more replies)
  2022-03-21 23:00 ` [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes patchwork-bot+netdevbpf
  2 siblings, 3 replies; 10+ messages in thread
From: Tobias Waldekranz @ 2022-03-18 20:13 UTC (permalink / raw)
  To: davem, kuba
  Cc: Marek Behun, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, Paolo Abeni, netdev, linux-kernel

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 <tobias@waldekranz.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
@ 2022-03-18 20:40   ` Vladimir Oltean
  2022-03-18 21:23   ` Florian Fainelli
  2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2022-03-18 20:40 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, Marek Behún, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Paolo Abeni, netdev, linux-kernel

On Fri, Mar 18, 2022 at 09:13:20PM +0100, Tobias Waldekranz wrote:
> 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 <kabel@kernel.org>
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

(with the mention that Marek's problem is probably still not solved)

>  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
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
  2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
@ 2022-03-18 20:41   ` Vladimir Oltean
  2022-03-18 21:23   ` Florian Fainelli
  2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2022-03-18 20:41 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, Marek Behun, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Paolo Abeni, netdev, linux-kernel

On Fri, Mar 18, 2022 at 09:13:21PM +0100, Tobias Waldekranz wrote:
> 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 <tobias@waldekranz.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

>  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
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
  2022-03-18 20:40   ` Vladimir Oltean
@ 2022-03-18 21:23   ` Florian Fainelli
  2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-03-18 21:23 UTC (permalink / raw)
  To: Tobias Waldekranz, davem, kuba
  Cc: Marek Behún, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	Paolo Abeni, netdev, linux-kernel

On 3/18/22 1:13 PM, Tobias Waldekranz wrote:
> 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 <kabel@kernel.org>
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
  2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
  2022-03-18 20:41   ` Vladimir Oltean
@ 2022-03-18 21:23   ` Florian Fainelli
  2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-03-18 21:23 UTC (permalink / raw)
  To: Tobias Waldekranz, davem, kuba
  Cc: Marek Behun, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	Paolo Abeni, netdev, linux-kernel

On 3/18/22 1:13 PM, Tobias Waldekranz wrote:
> 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 <tobias@waldekranz.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
  2022-03-18 20:40   ` Vladimir Oltean
  2022-03-18 21:23   ` Florian Fainelli
@ 2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Marek Behún @ 2022-03-19 19:00 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, Paolo Abeni, netdev, linux-kernel

On Fri, 18 Mar 2022 21:13:20 +0100
Tobias Waldekranz <tobias@waldekranz.com> wrote:

> 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 <kabel@kernel.org>
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>

Tested-by: Marek Behún <kabel@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
  2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
  2022-03-18 20:41   ` Vladimir Oltean
  2022-03-18 21:23   ` Florian Fainelli
@ 2022-03-19 19:00   ` Marek Behún
  2 siblings, 0 replies; 10+ messages in thread
From: Marek Behún @ 2022-03-19 19:00 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, Paolo Abeni, netdev, linux-kernel

On Fri, 18 Mar 2022 21:13:21 +0100
Tobias Waldekranz <tobias@waldekranz.com> wrote:

> 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 <tobias@waldekranz.com>

Tested-by: Marek Behún <kabel@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes
  2022-03-18 20:13 [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes Tobias Waldekranz
  2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
  2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
@ 2022-03-21 23:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-21 23:00 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, kabel, andrew, vivien.didelot, f.fainelli, olteanv,
	pabeni, netdev, linux-kernel

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-21 23:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 20:13 [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes Tobias Waldekranz
2022-03-18 20:13 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Tobias Waldekranz
2022-03-18 20:40   ` Vladimir Oltean
2022-03-18 21:23   ` Florian Fainelli
2022-03-19 19:00   ` Marek Behún
2022-03-18 20:13 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback Tobias Waldekranz
2022-03-18 20:41   ` Vladimir Oltean
2022-03-18 21:23   ` Florian Fainelli
2022-03-19 19:00   ` Marek Behún
2022-03-21 23:00 ` [PATCH net-next 0/2] net: dsa: mv88e6xxx: MST Fixes patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.