From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "Arun.Ramadoss@microchip.com" <Arun.Ramadoss@microchip.com>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"idosch@nvidia.com" <idosch@nvidia.com>,
"linux@rempel-privat.de" <linux@rempel-privat.de>,
"petrm@nvidia.com" <petrm@nvidia.com>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"hauke@hauke-m.de" <hauke@hauke-m.de>,
"martin.blumenstingl@googlemail.com"
<martin.blumenstingl@googlemail.com>,
Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Woojung.Huh@microchip.com" <Woojung.Huh@microchip.com>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [RFC PATCH net-next 3/3] net: dsa: never skip VLAN configuration
Date: Mon, 18 Jul 2022 16:24:35 +0000 [thread overview]
Message-ID: <20220718162434.72fqamkv4v274tny@skbuf> (raw)
In-Reply-To: <d7dc941bf816a6af97c84bdbb527bf9c0eb02730.camel@microchip.com>
Hi Arun,
On Mon, Jul 18, 2022 at 02:34:33PM +0000, Arun.Ramadoss@microchip.com wrote:
> Hi Vladimir,
> There was a mistake in our testing on the latest code base of net-next.
> Today we tried in the latest net-next and following are the
> observation.
>
> Scenario 1: Before applying the patch
> ------------------------------
> ip link set dev br0 type bridge vlan_filtering 0
>
> bridge vlan add vid 10 dev lan1 pvid untagged
> bridge vlan add vid 10 dev lan2 pvid untagged
"bridge vlan add" on lan2 was never part of the test instructions.
>
> We got warning skipping configuration of VLAN and ksz_port_vlan_add()
> is not called.
>
> Packet is received in Host2 when transmitted from Host1. So there is no
> breakage in the forwarding.
Nonetheless it's good to know that the control scenario behaves as
expected, i.e. the VLANs are skipped while VLAN-unaware (and therefore,
the port hardware PVID remains what it was).
> Scenario 2: After applying the patch
> ----------------------------
> ip link set dev br0 type bridge vlan_filtering 0
>
> bridge vlan add vid 10 dev lan1 pvid untagged
>
> --> Packet is not received in the Host2
The problem is exactly here. The driver should pass packets at this stage.
This is because the bridge is still VLAN-unaware, despite its VLAN-aware
pvid VLAN having been changed from 1 (vlan_default_pvid) to 10.
> bridge vlan add vid 10 dev lan2 pvid untagged
>
> --> packet is received in the Host2
This only goes to prove that the VLAN in which the switch processes
traffic while VLAN-unaware is the PVID of the port. So when the PVID on
the ingress and egress ports matches, forwarding is naturally restored.
> bridge vlan del vid 10 dev lan1
>
> --> packet is received in the Host2
>
> bridge vlan del vid 10 dev lan2
>
> --> packet is received in the Host2
>
> * Let us know, do we need to test anything further on this.
Yes, now you need to go fix the driver :) Please read the comments from
this patch and the series in general (including cover letter), they
point to similar issues in other drivers and to commits which have
solved them. I need the ksz driver to work properly before I can delete
the configure_vlan_while_not_filtering workaround. Generally speaking,
the PVID needs to be committed to hardware based on a smarter logic, see
this for example (and all the places from which it is called):
static int mv88e6xxx_port_commit_pvid(struct mv88e6xxx_chip *chip, int port)
{
struct dsa_port *dp = dsa_to_port(chip->ds, port);
struct net_device *br = dsa_port_bridge_dev_get(dp);
struct mv88e6xxx_port *p = &chip->ports[port];
u16 pvid = MV88E6XXX_VID_STANDALONE; // Dedicated PVID for standalone mode
bool drop_untagged = false;
int err;
if (br) {
if (br_vlan_enabled(br)) {
pvid = p->bridge_pvid.vid; // PVID is inherited from bridge only if the bridge is *currently* VLAN-aware
drop_untagged = !p->bridge_pvid.valid;
} else {
pvid = MV88E6XXX_VID_BRIDGED; // Dedicated PVID for VLAN-unaware bridging
}
}
err = mv88e6xxx_port_set_pvid(chip, port, pvid);
if (err)
return err;
return mv88e6xxx_port_drop_untagged(chip, port, drop_untagged);
}
Additionally, DaveM has just merged some DSA documentation updates which
I think are very relevant to this discussion. See the new "Address databases"
chapter for a review of how things are supposed to actually work when
done carefully:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/tree/Documentation/networking/dsa/dsa.rst#n730
Thanks!
next prev parent reply other threads:[~2022-07-18 16:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 17:31 [RFC PATCH net-next 0/3] Delete ds->configure_vlan_while_not_filtering Vladimir Oltean
2022-07-05 17:31 ` [RFC PATCH net-next 1/3] selftests: forwarding: add a vlan_deletion test to bridge_vlan_unaware Vladimir Oltean
2022-07-07 12:13 ` Ido Schimmel
2022-07-07 13:34 ` Martin Blumenstingl
2022-07-07 13:45 ` Vladimir Oltean
2022-07-05 17:31 ` [RFC PATCH net-next 2/3] net: dsa: ar9331: remove ds->configure_vlan_while_not_filtering Vladimir Oltean
2022-07-05 17:31 ` [RFC PATCH net-next 3/3] net: dsa: never skip VLAN configuration Vladimir Oltean
2022-07-06 10:51 ` Arun.Ramadoss
2022-07-06 11:12 ` Vladimir Oltean
2022-07-06 16:33 ` Martin Blumenstingl
2022-07-06 16:45 ` Vladimir Oltean
2022-07-06 19:57 ` Martin Blumenstingl
2022-07-07 22:31 ` Vladimir Oltean
2022-07-08 10:00 ` Martin Blumenstingl
2022-07-08 12:09 ` Vladimir Oltean
2022-07-08 22:27 ` Martin Blumenstingl
2022-07-14 10:46 ` Arun.Ramadoss
2022-07-14 15:12 ` Vladimir Oltean
2022-07-15 9:23 ` Arun.Ramadoss
2022-07-15 15:26 ` Vladimir Oltean
2022-07-18 14:34 ` Arun.Ramadoss
2022-07-18 16:24 ` Vladimir Oltean [this message]
2022-07-26 15:10 ` Arun.Ramadoss
2022-07-26 17:21 ` Vladimir Oltean
2022-09-12 15:30 ` Arun.Ramadoss
2022-09-12 15:42 ` Vladimir Oltean
2022-09-13 10:57 ` Arun.Ramadoss
2022-09-13 15:09 ` Vladimir Oltean
2022-07-06 20:04 ` Hauke Mehrtens
2022-07-07 22:54 ` 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=20220718162434.72fqamkv4v274tny@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=Arun.Ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hauke@hauke-m.de \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux@rempel-privat.de \
--cc=martin.blumenstingl@googlemail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=vivien.didelot@gmail.com \
--cc=xiaoliang.yang_1@nxp.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