From: Vladimir Oltean <olteanv@gmail.com>
To: Vivien Didelot <vivien.didelot@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, f.fainelli@gmail.com, andrew@lunn.ch
Subject: Re: [PATCH net-next 6/6] net: dsa: clear VLAN flags for CPU port
Date: Fri, 23 Aug 2019 02:51:22 +0300 [thread overview]
Message-ID: <aee63928-a99e-3849-c8b4-dee9b660247c@gmail.com> (raw)
In-Reply-To: <20190822201323.1292-7-vivien.didelot@gmail.com>
On 8/22/19 11:13 PM, Vivien Didelot wrote:
> When the bridge offloads a VLAN on a slave port, we also need to
> program its dedicated CPU port as a member of the VLAN.
>
> Drivers may handle the CPU port's membership as they want. For example,
> Marvell as a special "Unmodified" mode to pass frames as is through
> such ports.
>
> Even though DSA expects the drivers to handle the CPU port membership,
> they are unlikely to program such VLANs untagged, and certainly not as
> PVID. This patch clears the VLAN flags before programming the CPU port.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> Suggested-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> net/dsa/slave.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 8267c156a51a..48df48f76c67 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -332,6 +332,12 @@ static int dsa_slave_vlan_add(struct net_device *dev,
> if (err)
> return err;
>
> + /* We need the dedicated CPU port to be a member of the VLAN as well.
> + * Even though drivers often handle CPU membership in special ways,
> + * CPU ports are likely to be tagged, so clear the VLAN flags.
> + */
> + vlan.flags = 0;
> +
How does this work exactly?
If I run 'sudo bridge vlan add vid 1 dev swp4 pvid untagged', then the
CPU port starts sending VLAN-tagged traffic. I see this in tcpdump on
the DSA master port, but if I tcpdump on swp4, the VLAN tag is removed.
Who is doing that?
> err = dsa_port_vlan_add(dp->cpu_dp, &vlan, trans);
> if (err)
> return err;
>
next prev parent reply other threads:[~2019-08-22 23:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 20:13 [PATCH net-next 0/6] net: dsa: explicit programmation of VLAN on CPU ports Vivien Didelot
2019-08-22 20:13 ` [PATCH net-next 1/6] net: dsa: remove bitmap operations Vivien Didelot
2019-08-22 20:13 ` [PATCH net-next 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add Vivien Didelot
2019-08-22 22:06 ` Vladimir Oltean
2019-08-22 23:43 ` Vivien Didelot
2019-08-22 23:44 ` Vladimir Oltean
2019-08-23 16:23 ` Florian Fainelli
2019-08-23 16:32 ` Vladimir Oltean
2019-08-23 16:49 ` Florian Fainelli
2019-08-22 20:13 ` [PATCH net-next 3/6] net: dsa: add slave VLAN helpers Vivien Didelot
2019-08-22 20:13 ` [PATCH net-next 4/6] net: dsa: check bridge VLAN in slave operations Vivien Didelot
2019-08-22 20:13 ` [PATCH net-next 5/6] net: dsa: program VLAN on CPU port from slave Vivien Didelot
2019-08-23 15:44 ` Vladimir Oltean
2019-08-22 20:13 ` [PATCH net-next 6/6] net: dsa: clear VLAN flags for CPU port Vivien Didelot
2019-08-22 23:51 ` Vladimir Oltean [this message]
2019-08-23 17:00 ` Florian Fainelli
2019-08-24 19:53 ` Vladimir Oltean
2019-08-25 17:28 ` Vivien Didelot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aee63928-a99e-3849-c8b4-dee9b660247c@gmail.com \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox