netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mv88e6xxx: fixed adding vlan 0
@ 2021-06-21  8:41 Eldar Gasanov
  0 siblings, 0 replies; 8+ messages in thread
From: Eldar Gasanov @ 2021-06-21  8:41 UTC (permalink / raw)
  To: netdev
  Cc: Eldar Gasanov, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, David S. Miller, Jakub Kicinski

8021q module adds vlan 0 to all interfaces when it starts.
When 8021q module is loaded it isn't possible to create bond
with mv88e6xxx interfaces, bonding module dipslay error
"Couldn't add bond vlan ids", because it tries to add vlan 0
to slave interfaces.

There is unexpected behavior in the switch. When a PVID
is assigned to a port the switch changes VID to PVID
in ingress frames with VID 0 on the port. Expected
that the switch doesn't assign PVID to tagged frames
with VID 0. But there isn't a way to change this behavior
in the switch.
---
 drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index eca285aaf72f..3c6ca9028251 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1618,9 +1618,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
 	struct mv88e6xxx_vtu_entry vlan;
 	int i, err;
 
-	if (!vid)
-		return -EOPNOTSUPP;
-
 	/* DSA and CPU ports have to be members of multiple vlans */
 	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
 		return 0;
@@ -2109,6 +2106,9 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
 	u8 member;
 	int err;
 
+	if (!vlan->vid)
+		return 0;
+
 	err = mv88e6xxx_port_vlan_prepare(ds, port, vlan);
 	if (err)
 		return err;
@@ -6355,7 +6355,7 @@ static const struct of_device_id mv88e6xxx_of_match[] = {
 		.data = &mv88e6xxx_table[MV88E6085],
 	},
 	{
-		.compatible = "marvell,mv88e6190",
+		.compatible = "marvell,mv88e6190",mv88e6xxx_g1_vtu_vid_write
 		.data = &mv88e6xxx_table[MV88E6190],
 	},
 	{
-- 
2.25.1


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

* Re: [PATCH] mv88e6xxx: fixed adding vlan 0
  2021-06-21 21:50 ` patchwork-bot+netdevbpf
@ 2021-06-21 21:52   ` Florian Fainelli
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2021-06-21 21:52 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf, Eldar Gasanov
  Cc: netdev, andrew, vivien.didelot, olteanv, davem, kuba

On 6/21/21 2:50 PM, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
> 
> This patch was applied to netdev/net.git (refs/heads/master):
> 
> On Mon, 21 Jun 2021 11:54:38 +0300 you wrote:
>> 8021q module adds vlan 0 to all interfaces when it starts.
>> When 8021q module is loaded it isn't possible to create bond
>> with mv88e6xxx interfaces, bonding module dipslay error
>> "Couldn't add bond vlan ids", because it tries to add vlan 0
>> to slave interfaces.
>>
>> There is unexpected behavior in the switch. When a PVID
>> is assigned to a port the switch changes VID to PVID
>> in ingress frames with VID 0 on the port. Expected
>> that the switch doesn't assign PVID to tagged frames
>> with VID 0. But there isn't a way to change this behavior
>> in the switch.
>>
>> [...]
> 
> Here is the summary with links:
>   - mv88e6xxx: fixed adding vlan 0
>     https://git.kernel.org/netdev/net/c/b8b79c414eca

This version would ideally have been applied instead:

https://lore.kernel.org/netdev/20210621134703.33933-1-eldargasanov2@gmail.com/
-- 
Florian

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

* Re: [PATCH] mv88e6xxx: fixed adding vlan 0
  2021-06-21  8:54 Eldar Gasanov
  2021-06-21 10:04 ` Vladimir Oltean
  2021-06-21 11:30 ` Marek Behún
@ 2021-06-21 21:50 ` patchwork-bot+netdevbpf
  2021-06-21 21:52   ` Florian Fainelli
  2 siblings, 1 reply; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-21 21:50 UTC (permalink / raw)
  To: Eldar Gasanov
  Cc: netdev, andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 21 Jun 2021 11:54:38 +0300 you wrote:
> 8021q module adds vlan 0 to all interfaces when it starts.
> When 8021q module is loaded it isn't possible to create bond
> with mv88e6xxx interfaces, bonding module dipslay error
> "Couldn't add bond vlan ids", because it tries to add vlan 0
> to slave interfaces.
> 
> There is unexpected behavior in the switch. When a PVID
> is assigned to a port the switch changes VID to PVID
> in ingress frames with VID 0 on the port. Expected
> that the switch doesn't assign PVID to tagged frames
> with VID 0. But there isn't a way to change this behavior
> in the switch.
> 
> [...]

Here is the summary with links:
  - mv88e6xxx: fixed adding vlan 0
    https://git.kernel.org/netdev/net/c/b8b79c414eca

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] 8+ messages in thread

* Re: [PATCH] mv88e6xxx: fixed adding vlan 0
  2021-06-21  8:54 Eldar Gasanov
  2021-06-21 10:04 ` Vladimir Oltean
@ 2021-06-21 11:30 ` Marek Behún
  2021-06-21 21:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 8+ messages in thread
From: Marek Behún @ 2021-06-21 11:30 UTC (permalink / raw)
  To: Eldar Gasanov
  Cc: netdev, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, David S. Miller, Jakub Kicinski

On Mon, 21 Jun 2021 11:54:38 +0300
Eldar Gasanov <eldargasanov2@gmail.com> wrote:

> 8021q module adds vlan 0 to all interfaces when it starts.
> When 8021q module is loaded it isn't possible to create bond
> with mv88e6xxx interfaces, bonding module dipslay error
> "Couldn't add bond vlan ids", because it tries to add vlan 0
> to slave interfaces.
> 
> There is unexpected behavior in the switch. When a PVID
> is assigned to a port the switch changes VID to PVID
> in ingress frames with VID 0 on the port. Expected
> that the switch doesn't assign PVID to tagged frames
> with VID 0. But there isn't a way to change this behavior
> in the switch.
> 
> Signed-off-by: Eldar Gasanov <eldargasanov2@gmail.com>

Patch subject should be
  net: dsa: mv88e6xxx: Fix adding VLAN 0

We use present simple tense in commit messages.

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

* Re: [PATCH] mv88e6xxx: fixed adding vlan 0
  2021-06-21  8:54 Eldar Gasanov
@ 2021-06-21 10:04 ` Vladimir Oltean
  2021-06-21 11:30 ` Marek Behún
  2021-06-21 21:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 8+ messages in thread
From: Vladimir Oltean @ 2021-06-21 10:04 UTC (permalink / raw)
  To: Eldar Gasanov
  Cc: netdev, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	David S. Miller, Jakub Kicinski

On Mon, Jun 21, 2021 at 11:54:38AM +0300, Eldar Gasanov wrote:
> 8021q module adds vlan 0 to all interfaces when it starts.
> When 8021q module is loaded it isn't possible to create bond
> with mv88e6xxx interfaces, bonding module dipslay error
> "Couldn't add bond vlan ids", because it tries to add vlan 0
> to slave interfaces.
> 
> There is unexpected behavior in the switch. When a PVID
> is assigned to a port the switch changes VID to PVID
> in ingress frames with VID 0 on the port. Expected
> that the switch doesn't assign PVID to tagged frames
> with VID 0. But there isn't a way to change this behavior
> in the switch.
> 
> Signed-off-by: Eldar Gasanov <eldargasanov2@gmail.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index eca285aaf72f..961fa6b75cad 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1618,9 +1618,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
>  	struct mv88e6xxx_vtu_entry vlan;
>  	int i, err;
>  
> -	if (!vid)
> -		return -EOPNOTSUPP;
> -
>  	/* DSA and CPU ports have to be members of multiple vlans */
>  	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
>  		return 0;
> @@ -2109,6 +2106,9 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
>  	u8 member;
>  	int err;
>  
> +	if (!vlan->vid)
> +		return 0;
> +
>  	err = mv88e6xxx_port_vlan_prepare(ds, port, vlan);
>  	if (err)
>  		return err;
> -- 
> 2.25.1
> 

Fixes: 57e661aae6a8 ("net: dsa: mv88e6xxx: Link aggregation support")

because that's when this started becoming a problem.

and the patch should go to "net".

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

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

* [PATCH] mv88e6xxx: fixed adding vlan 0
@ 2021-06-21  8:54 Eldar Gasanov
  2021-06-21 10:04 ` Vladimir Oltean
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Eldar Gasanov @ 2021-06-21  8:54 UTC (permalink / raw)
  Cc: netdev, Eldar Gasanov, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S. Miller,
	Jakub Kicinski

8021q module adds vlan 0 to all interfaces when it starts.
When 8021q module is loaded it isn't possible to create bond
with mv88e6xxx interfaces, bonding module dipslay error
"Couldn't add bond vlan ids", because it tries to add vlan 0
to slave interfaces.

There is unexpected behavior in the switch. When a PVID
is assigned to a port the switch changes VID to PVID
in ingress frames with VID 0 on the port. Expected
that the switch doesn't assign PVID to tagged frames
with VID 0. But there isn't a way to change this behavior
in the switch.

Signed-off-by: Eldar Gasanov <eldargasanov2@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index eca285aaf72f..961fa6b75cad 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1618,9 +1618,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
 	struct mv88e6xxx_vtu_entry vlan;
 	int i, err;
 
-	if (!vid)
-		return -EOPNOTSUPP;
-
 	/* DSA and CPU ports have to be members of multiple vlans */
 	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
 		return 0;
@@ -2109,6 +2106,9 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
 	u8 member;
 	int err;
 
+	if (!vlan->vid)
+		return 0;
+
 	err = mv88e6xxx_port_vlan_prepare(ds, port, vlan);
 	if (err)
 		return err;
-- 
2.25.1


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

* Re: [PATCH] mv88e6xxx: fixed adding vlan 0
  2021-05-17  6:25 Eldar Gasanov
@ 2021-05-17 15:00 ` Vladimir Oltean
  0 siblings, 0 replies; 8+ messages in thread
From: Vladimir Oltean @ 2021-05-17 15:00 UTC (permalink / raw)
  To: Eldar Gasanov
  Cc: netdev, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	David S. Miller, Jakub Kicinski

Hi Eldar,

On Mon, May 17, 2021 at 09:25:06AM +0300, Eldar Gasanov wrote:
> 8021q module adds vlan 0 to all interfaces when it starts.
> When 8021q module is loaded it isn't possible to create bond
> with mv88e6xxx interfaces, bonding module dipslay error
> "Couldn't add bond vlan ids", because it tries to add vlan 0
> to slave interfaces.
> 
> Signed-off-by: Eldar Gasanov <eldargasanov2@gmail.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index eca285aaf72f..961fa6b75cad 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1618,9 +1618,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
>  	struct mv88e6xxx_vtu_entry vlan;
>  	int i, err;
>  
> -	if (!vid)
> -		return -EOPNOTSUPP;
> -
>  	/* DSA and CPU ports have to be members of multiple vlans */
>  	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
>  		return 0;
> @@ -2109,6 +2106,9 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
>  	u8 member;
>  	int err;
>  
> +	if (!vlan->vid)
> +		return 0;
> +
>  	err = mv88e6xxx_port_vlan_prepare(ds, port, vlan);
>  	if (err)
>  		return err;
> -- 
> 2.25.1
> 

Thank you for your patch.

The reason why the 8021q module adds VLAN 0 to the hardware filtering
list of the network device is to ensure that 802.1p-tagged packets are
always received and treated as untagged, while on the other hand
preserving their VLAN ID of 0.

This is described in commit ad1afb003939 ("vlan_dev: VLAN 0 should be
treated as "no vlan tag" (802.1p packet)").

When we look at vlan_device_event(), we see that vlan_vid_add() is
called without checking the error code. So when mv88e6xxx returns
-EOPNOTSUPP, the code carries along.

I spot an inconsistency within the 8021q module, because
vlan_vids_add_by_dev() then checks the return code of vlan_vid_add(),
resulting in the problem you are trying to fix here. I think it would be
more self-consistent if vlan_vids_add_by_dev() would propagate the error
only if vid is != 0.

It can be said that the bug you are fixing is a regression introduced by
my commit 9b236d2a69da ("net: dsa: Advertise the VLAN offload netdev
ability only if switch supports it"). Tobias too tried to fix it here:
https://patchwork.kernel.org/project/netdevbpf/cover/20210308150405.3694678-1-tobias@waldekranz.com/

However that is not the central point. Ignoring the errors operates in
the good faith that the real_dev driver knows what it's doing, and
satisfies the requirements of commit ad1afb003939 mentioned above. This
is user-visible behavior, so it should better be compliant. And this is
where I am not 100% clear on what is going on.

The mv88e6xxx driver can refuse the configuration of VLAN ID 0 if it
does the right thing and we can make either the mv88e6xxx layer, or the
DSA layer (Tobias's patch) or the 8021q layer ignore that error code.
But I would like to make sure that in either case, a packet with VID 0
received by the mv88e6xxx ports will still contain VID 0, in the
following situations:

- The port is standalone
- The port is under a VLAN-unaware bridge
- The port is under a VLAN-aware bridge

I happen to have a mv88e6xxx testing device, and what I see is not
exactly that. In the first two cases, we are ok, but when the port is
under a VLAN-aware bridge, the packets are received as PVID-tagged:

# ip link add br0 type bridge vlan_filtering 1
# ip link set lan24 master br0
# bridge vlan add dev lan24 vid 34 pvid untagged
# tcpdump -i lan24 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lan24, link-type EN10MB (Ethernet), capture size 262144 bytes
17:32:29.896736 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9a7 d040  ...............@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0001  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.898292 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9b7 1280  ................
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0002  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.898713 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9c6 54c0  ..............T.
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0003  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.899674 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9d5 9700  ................
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0004  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.902377 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9e4 d940  ...............@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0005  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.904425 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 a9f4 1b80  ................
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0006  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.905049 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 aa03 5dc0  ..............].
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0007  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.906571 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 aa12 a000  ................
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0008  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.907048 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 aa21 e240  .............!.@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0009  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:32:29.907575 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 34, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2ef4 aa31 2480  .............1$.
        0x0010:  0000 0000 0000 0000 0000 0000 0000 000a  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
# ip link set br0 type bridge vlan_filtering 0
# tcpdump -i lan24 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lan24, link-type EN10MB (Ethernet), capture size 262144 bytes
17:34:39.884637 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee42 6440  ........../..Bd@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0001  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.885968 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee51 a680  ........../..Q..
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0002  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.886179 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee60 e8c0  ........../..`..
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0003  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.886559 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee70 2b00  ........../..p+.
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0004  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.887116 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee7f 6d40  ........../...m@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0005  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.888090 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee8e af80  ........../.....
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0006  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.890813 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 ee9d f1c0  ........../.....
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0007  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.892526 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 eead 3400  ........../...4.
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0008  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.893230 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 eebc 7640  ........../...v@
        0x0010:  0000 0000 0000 0000 0000 0000 0000 0009  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............
17:34:39.895026 00:1f:7b:63:02:08 > d8:58:d7:00:ca:6d, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 0x88f7,
        0x0000:  0402 0000 0000 0000 15f1 2f12 eecb b880  ........../.....
        0x0010:  0000 0000 0000 0000 0000 0000 0000 000a  ................
        0x0020:  0000 dead beef dead beef dead beef       ..............

The packets that were sent to the switch were the same in both cases.

Strange, huh?

There must be some VLAN retagging going on in the switch between VLAN ID
0 and the port's PVID, but I can't find it.

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

* [PATCH] mv88e6xxx: fixed adding vlan 0
@ 2021-05-17  6:25 Eldar Gasanov
  2021-05-17 15:00 ` Vladimir Oltean
  0 siblings, 1 reply; 8+ messages in thread
From: Eldar Gasanov @ 2021-05-17  6:25 UTC (permalink / raw)
  Cc: netdev, Eldar Gasanov, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S. Miller,
	Jakub Kicinski

8021q module adds vlan 0 to all interfaces when it starts.
When 8021q module is loaded it isn't possible to create bond
with mv88e6xxx interfaces, bonding module dipslay error
"Couldn't add bond vlan ids", because it tries to add vlan 0
to slave interfaces.

Signed-off-by: Eldar Gasanov <eldargasanov2@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index eca285aaf72f..961fa6b75cad 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1618,9 +1618,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
 	struct mv88e6xxx_vtu_entry vlan;
 	int i, err;
 
-	if (!vid)
-		return -EOPNOTSUPP;
-
 	/* DSA and CPU ports have to be members of multiple vlans */
 	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
 		return 0;
@@ -2109,6 +2106,9 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
 	u8 member;
 	int err;
 
+	if (!vlan->vid)
+		return 0;
+
 	err = mv88e6xxx_port_vlan_prepare(ds, port, vlan);
 	if (err)
 		return err;
-- 
2.25.1


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

end of thread, other threads:[~2021-06-21 21:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  8:41 [PATCH] mv88e6xxx: fixed adding vlan 0 Eldar Gasanov
  -- strict thread matches above, loose matches on Subject: below --
2021-06-21  8:54 Eldar Gasanov
2021-06-21 10:04 ` Vladimir Oltean
2021-06-21 11:30 ` Marek Behún
2021-06-21 21:50 ` patchwork-bot+netdevbpf
2021-06-21 21:52   ` Florian Fainelli
2021-05-17  6:25 Eldar Gasanov
2021-05-17 15:00 ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).