netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Tobias Waldekranz <tobias@waldekranz.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, vivien.didelot@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [RFC net] net: dsa: Centralize validation of VLAN configuration
Date: Wed, 10 Mar 2021 01:36:55 +0100	[thread overview]
Message-ID: <YEgUp0E9uCtBjP5I@lunn.ch> (raw)
In-Reply-To: <20210309220119.t24sdc7cqqfxhpfb@skbuf>

> > .100  br0  .100
> >    \  / \  /
> >    lan0 lan1
> > 
> > $ ip link add dev br0 type bridge vlan_filtering 1
> > $ ip link add dev lan0.100 link lan0 type vlan id 100
> > $ ip link add dev lan1.100 link lan1 type vlan id 100
> > $ ip link set dev lan0 master br0
> > $ ip link set dev lan1 master br0 # This should fail

> > 
> > .100  br0
> >    \  / \
> >    lan0 lan1
> > 
> > $ ip link add dev br0 type bridge vlan_filtering 1
> > $ ip link add dev lan0.100 link lan0 type vlan id 100
> > $ ip link set dev lan0 master br0
> > $ ip link set dev lan1 master br0
> > $ bridge vlan add dev lan1 vid 100 # This should fail
> 
> diff --git a/tools/testing/selftests/drivers/net/dsa/vlan_validation.sh b/tools/testing/selftests/drivers/net/dsa/vlan_validation.sh

Hi Vladimir

Cool to see self tests.

> new file mode 100755
> index 000000000000..445ce17cb925
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/dsa/vlan_validation.sh
> @@ -0,0 +1,316 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +NUM_NETIFS=2
> +lib_dir=$(dirname $0)/../../../net/forwarding
> +source $lib_dir/lib.sh
> +
> +eth0=${NETIFS[p1]}
> +eth1=${NETIFS[p2]}

Could these be called lan0 and lan1, so they match the diagrams?  I
find eth0 confusing, since that is often the master interface, not a
slave interface.

      Andrew

  reply	other threads:[~2021-03-10  0:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 18:42 [RFC net] net: dsa: Centralize validation of VLAN configuration Tobias Waldekranz
2021-03-09 20:40 ` Florian Fainelli
2021-03-09 21:28   ` Tobias Waldekranz
2021-03-09 22:01     ` Vladimir Oltean
2021-03-10  0:36       ` Andrew Lunn [this message]
2021-03-14 21:40       ` Tobias Waldekranz
2021-03-15  9:29         ` Vladimir Oltean
2021-03-10  0:30     ` Andrew Lunn
2021-03-10  0:51       ` Vladimir Oltean

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=YEgUp0E9uCtBjP5I@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=tobias@waldekranz.com \
    --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;
as well as URLs for NNTP newsgroup(s).