Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: stijncleynhens@gmail.com
Cc: netdev@vger.kernel.org, linusw@kernel.org, luizluca@gmail.com,
	alvin.sipraga@analog.com, andrew@lunn.ch, olteanv@gmail.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, namiltd@yahoo.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net: dsa: realtek: rtl8365mb: use IVL in VLAN 0
Date: Sun, 08 Nov 2026 08:43:44 +0000	[thread overview]
Message-ID: <179412742402.994134.1195257082406220235@kernel.org> (raw)
In-Reply-To: <20261104082514.2139278-2-stijncleynhens@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message says "On its own this has no visible effect".

--

net: dsa: realtek: rtl8365mb: use IVL in VLAN 0

This commit adds rtl8365mb_vlan_4k_setup_neutral() and calls it from
rtl8365mb_vlan_setup(). The helper sets Independent VLAN Learning on the
VLAN4k entry of VID 0, so that lookups and learning match the IVL-keyed
FDB and MDB entries the driver installs for VID 0.

> On its own this has no visible effect: standalone ports do not learn and
> the driver does not control host flooding, so the unused static entries
> only meant that traffic was flooded to the CPU. The next patch, which
> moves VLAN-unaware bridges onto VID 0, depends on it.

[ ... ]

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_vlan.c b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> index 8d49ffadce926..58948e76f122a 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> @@ -322,6 +322,37 @@ rtl8365mb_vlan_4k_port_set(struct dsa_switch *ds, int port,
>  	return 0;
>  }
>  
> +/*
> + * rtl8365mb_vlan_4k_setup_neutral() - Use IVL in the neutral VLAN
> + * @priv: realtek_priv pointer
> + *
> + * Untagged frames of standalone ports and of ports in a VLAN-unaware bridge
> + * are classified to VID 0, the VID of the neutral PVID. No bridge VLAN sets
> + * up its VLAN4k entry, which by default uses Shared VLAN Learning, so the
> + * switch would learn these frames by FID while the driver installs its FDB
> + * and MDB entries for VID 0 with Independent VLAN Learning. Use IVL in VID 0
> + * as in every other VLAN.

[Severity: Low]
The commit message paragraph quoted above says "On its own this has no
visible effect". Does that hold for ports in a VLAN-unaware bridge that
have no PVID?

You can reach that configuration by creating the bridge with
vlan_default_pvid 0, or by removing a port's PVID with bridge vlan del. At
this commit such a port falls back to the neutral PVID, which is VLANMC[0]
with EVID 0. rtl8365mb_vlan_pvid_port_clear() keeps the frame filter when
the port is not filtering, then sets the PVID index to 0:

rtl8365mb_vlan_pvid_port_clear() {
    ...
	} else {
		/* skip undo_set_framefilter */
		accepted_frame = prev_accepted_frame;
	}

	ret = rtl8365mb_vlan_port_set_pvid(priv, port, 0);
    ...
}

As a result, untagged frames on that port are classified to VID 0.

Standalone ports don't learn, but bridge ports do:

rtl83xx_port_bridge_join() {
    ...
	if (priv->ops->port_set_learning) {
		ret = priv->ops->port_set_learning(priv, port, true);
    ...
}

Before this patch, VLAN4k[0] used SVL, so the switch learned and looked
up these frames by FID 0. The IVL {VID 0} FDB and MDB entries that DSA
installs never matched. That includes bridge static entries and the
assisted learning entries on the CPU port.

This looks like the same roaming and hairpin drop scenario that the
follow-up patch "net: dsa: realtek: rtl8365mb: keep the neutral PVID in
VLAN-unaware bridges" describes. This patch fixes it on its own for
PVID-less VLAN-unaware bridge ports.

This patch has its own Fixes: tag. Could the commit message say that it
already changes forwarding for PVID-less VLAN-unaware bridge ports,
instead of only discussing standalone ports?

A related point about the new kernel-doc: it says untagged frames "of
ports in a VLAN-unaware bridge are classified to VID 0". At this commit,
ds->configure_vlan_while_not_filtering is set, so rtl8365mb_port_vlan_add()
programs the bridge PVID (VID 1 by default) even when filtering is off.
rtl8365mb_port_vlan_filtering() also doesn't reset the port to the
neutral PVID.

So the comment is only true for PVID-less ports until the next patch in
the series lands. The code change itself looks correct.

> + *
> + * Context: Can sleep. Must be called with &priv->vlan_lock held.
> + * Takes and releases &priv->map_lock.
> + * Return: 0 on success, or a negative error code on failure.
> + */

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261104082514.2139278-1-stijncleynhens%40gmail.com

  parent reply	other threads:[~2026-11-08  8:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  8:25 [PATCH net 0/2] net: dsa: realtek: rtl8365mb: fix FDB lookups in VLAN-unaware bridges Stijn Cleynhens
2026-11-04  8:25 ` [PATCH net 1/2] net: dsa: realtek: rtl8365mb: use IVL in VLAN 0 Stijn Cleynhens
2026-11-04 15:22   ` Alvin Šipraga
2026-11-06 15:01     ` Stijn Cleynhens
2026-11-08  8:43   ` netdev-bot+sashiko [this message]
2026-11-04  8:25 ` [PATCH net 2/2] net: dsa: realtek: rtl8365mb: keep the neutral PVID in VLAN-unaware bridges Stijn Cleynhens
2026-11-04 15:57   ` Alvin Šipraga
2026-11-06 15:02     ` Stijn Cleynhens
2026-11-08  8:43   ` netdev-bot+sashiko

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=179412742402.994134.1195257082406220235@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alvin.sipraga@analog.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luizluca@gmail.com \
    --cc=namiltd@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=stijncleynhens@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