From: Vivien Didelot <vivien.didelot@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: f.fainelli@gmail.com, andrew@lunn.ch, idosch@idosch.org,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com,
davem@davemloft.net, netdev@vger.kernel.org,
Vladimir Oltean <olteanv@gmail.com>
Subject: Re: [PATCH net-next 3/6] net: dsa: Delete the VID from the upstream port as well
Date: Tue, 20 Aug 2019 01:51:38 -0400 [thread overview]
Message-ID: <20190820015138.GB975@t480s.localdomain> (raw)
In-Reply-To: <20190820000002.9776-4-olteanv@gmail.com>
Vladimir,
On Tue, 20 Aug 2019 02:59:59 +0300, Vladimir Oltean <olteanv@gmail.com> wrote:
> Commit b2f81d304cee ("net: dsa: add CPU and DSA ports as VLAN members")
> is littering a lot. After deleting a VLAN added on a DSA port, it still
> remains installed in the hardware filter of the upstream port. Fix this.
Littering a lot, really?
FYI we are not removing the target VLAN from the hardware yet because it would
be too expensive to cache data in DSA core in order to know if the VID is not
used by any other slave port of the fabric anymore, and thus safe to remove.
Keeping the VID programmed for DSA and CPU ports is simpler for the moment,
as an hardware VLAN with only these ports as members is unlikely to harm.
>
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> net/dsa/switch.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/net/dsa/switch.c b/net/dsa/switch.c
> index 09d9286b27cc..84ab2336131e 100644
> --- a/net/dsa/switch.c
> +++ b/net/dsa/switch.c
> @@ -295,11 +295,20 @@ static int dsa_switch_vlan_del(struct dsa_switch *ds,
> struct dsa_notifier_vlan_info *info)
> {
> const struct switchdev_obj_port_vlan *vlan = info->vlan;
> + int port;
>
> if (!ds->ops->port_vlan_del)
> return -EOPNOTSUPP;
>
> + /* Build a mask of VLAN members */
> + bitmap_zero(ds->bitmap, ds->num_ports);
> if (ds->index == info->sw_index)
> + set_bit(info->port, ds->bitmap);
> + for (port = 0; port < ds->num_ports; port++)
> + if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
> + set_bit(port, ds->bitmap);
> +
> + for_each_set_bit(port, ds->bitmap, ds->num_ports)
> return ds->ops->port_vlan_del(ds, info->port, vlan);
You return right away from the loop? You use info->port instead of port?
>
> return 0;
Even if you patch wasn't badly broken, "bridge vlan del" targeting a single
switch port would also remove the VLAN from the CPU port and thus breaking
offloaded 802.1q. It would also remove it from the DSA ports interconnecting
multiple switches, thus breaking the 802.1q conduit for the whole fabric.
So you're not fixing anything here, but you're breaking single-chip and
cross-chip hardware VLAN. Seriously wtf is this patch?
NAK!
Vivien
next prev parent reply other threads:[~2019-08-20 5:51 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 23:59 [PATCH net-next 0/6] Dynamic toggling of vlan_filtering for SJA1105 DSA Vladimir Oltean
2019-08-19 23:59 ` [PATCH net-next 1/6] net: dsa: tag_8021q: Future-proof the reserved fields in the custom VID Vladimir Oltean
2019-08-20 3:16 ` Florian Fainelli
2019-08-19 23:59 ` [PATCH net-next 2/6] net: bridge: Populate the pvid flag in br_vlan_get_info Vladimir Oltean
2019-08-20 0:12 ` Nikolay Aleksandrov
2019-08-19 23:59 ` [PATCH net-next 3/6] net: dsa: Delete the VID from the upstream port as well Vladimir Oltean
2019-08-20 5:51 ` Vivien Didelot [this message]
2019-08-20 9:54 ` Vladimir Oltean
2019-08-20 17:52 ` Vivien Didelot
2019-08-20 19:40 ` Florian Fainelli
2019-08-20 20:40 ` Vladimir Oltean
2019-08-20 20:58 ` Vivien Didelot
2019-08-20 21:02 ` Vladimir Oltean
2019-08-20 21:36 ` Vivien Didelot
2019-08-20 22:09 ` Vladimir Oltean
2019-08-21 3:30 ` Vivien Didelot
2019-08-21 9:51 ` Vladimir Oltean
2019-08-20 0:00 ` [PATCH net-next 4/6] net: dsa: Don't program the VLAN as pvid on the upstream port Vladimir Oltean
2019-08-20 3:15 ` Florian Fainelli
2019-08-20 12:09 ` Vladimir Oltean
2019-08-20 22:43 ` Florian Fainelli
2019-08-20 6:07 ` Vivien Didelot
2019-08-20 10:22 ` Vladimir Oltean
2019-08-20 0:00 ` [PATCH net-next 5/6] net: dsa: Allow proper internal use of VLANs Vladimir Oltean
2019-08-20 3:20 ` Florian Fainelli
2019-08-20 0:00 ` [PATCH net-next 6/6] net: dsa: tag_8021q: Restore bridge pvid when enabling vlan_filtering Vladimir Oltean
2019-08-20 3:32 ` Florian Fainelli
2019-08-20 10:28 ` Vladimir Oltean
2019-08-20 17:36 ` Florian Fainelli
2019-08-20 23:24 ` Florian Fainelli
2019-08-20 8:04 ` [PATCH net-next 0/6] Dynamic toggling of vlan_filtering for SJA1105 DSA Vivien Didelot
2019-08-20 10:18 ` 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=20190820015138.GB975@t480s.localdomain \
--to=vivien.didelot@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=idosch@idosch.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=olteanv@gmail.com \
--cc=roopa@cumulusnetworks.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