๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12673

Re: [PATCH net 1/2] net: dsa: realtek: rtl8365mb: use IVL in VLAN 0

#12673
From: netdev-bot+sashiko
Date: Sun, 08 Nov 2026 08:43
111 lines
12160 bytes
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
Technical Details
Message-ID: <179412742402.994134.1195257082406220235@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358656-linux-kernel-netdev=dewy.ru
References: <20261104082514.2139278-2-stijncleynhens@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358656-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] net: dsa: realtek: rtl8365mb: use IVL in VLAN 0
Date: Sun, 08 Nov 2026 08:43:44 +0000
Organization: Usenet Network
Message-ID: <179412742402.994134.1195257082406220235@kernel.org>
References: <20261104082514.2139278-2-stijncleynhens@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="93252"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:baq4aqJO+JUEwC54SAugbf19zs0= sha256:kYAHwjo3Unzggu4YuIZsbHd1rWMU9q3G4XEuZbgrNkw=
	sha1:LtoN11Vz1gUkxn6+S3jStCUPNSU= sha256:aGNOSWfcAoKHG0na/fYlHMVD8ns/aOO3stOQC0QH2Pc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B7D33113536; Sun,  8 Nov 2026 11:44:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id z6jGim0Z1A8x;
	Sun,  8 Nov 2026 11:44:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-358656-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id AB95011078C; Sun,  8 Nov 2026 11:43:54 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id C0ABF615FF0; Sun,  8 Nov 2026 08:43:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794127431;
	b=5OKMq+0AaonEYVvb23n6hJKWhK422yfn3cjhwmieQRi9EGcuZ1OKk+lnkicbPaQ+VVUb
	 j2kz6l2sOClMquHv/EjBMRzodVQPUM0EoNiItb8Hd+NN9qFw49X5dl2rMUn72/6yMMbFY
	 zdGydjSxkmf0eueBJsbyexJNSrZQMkLiuBKKyGHhffEhHauNRux1vOM+TAv0mRO5yRCSX
	 xV6UV7sTlrk1lw5BZka+zqjJuKKuUJLlfr+c2GNKt6l5xclYzZX2knqPgSUyqXJJr0VtP
	 UwTamrAnlJCEvSIvfW7IbCo35obNA5CVJgXRhrjg358hWIeTUfucjqMhdjMC3xHwCXg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794127431;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=NTu6xQo3qc3xPnwGy2quUxpwZu0qheDm9O+kUYdRyQQ=;
	b=gQsOtKCdho0VfsaTN/nN/ELXUgFZxH1kobZsXkrrM5Fp/2RdxsBaTph0UEhDabcgmQ8W
	 fURegPhXl3x+w255goiFyrOFJrekR6M5DvTAZduWGXAnpr9KFTPeR/zRg+68Q2iLZF0c5
	 EHPanJ5VoSi0e2PO7pCvV8Wmbhfpvd6BOLGVptGCneozeb3fLSFAZE5ZyDJpy8yhwCL5q
	 TN8IJOFQobAiRFEldyiQzkOsH0dB2Knux/tV7OzRlmqEbIaYCTiCRZzBuIpxVHwEqWHfz
	 nXfkwLAW0Oe4hBoLrstTNhm3BjuivmRZ+QYvXQ9qHrCcieA1ZNBMUfNUVRopqGEMIHQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KoXkcmF+;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 63935606A332;
	Sun,  8 Nov 2026 08:43:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KoXkcmF+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794127425;
	b=Km9AOQyRxcETZYkbPsdT7aavuJUvVnw2Y8jmpZKiv8iC3RHKxSXFIwGEUNoLYYJhSsWG
	 hKJIrRl69K8iRvH1jhnx8r8/4SEUqS/o+8mlaMaeL2/3+yk/Xp854pN8yTlTiC0kN4bOx
	 0ioUVZWYyoqbSSyeKDwq7c5AtM7I1guW9kmZgFX+JF9AaZ8jdOjMuUK6L9KdPJ3g0MDHx
	 RLdDiQFKg9enkG/DwYYhcPXzJWJosxvTaNinju1YKkc6iLG4WuvvSucBuJ9V41bQS5BCP
	 fBhMHbLc0eSd0E5Vb7GqqF+N5fH51hIFnvm9p0A/5cM78hh+o0j1nvCba8qwGXj7iAg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794127425;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=NTu6xQo3qc3xPnwGy2quUxpwZu0qheDm9O+kUYdRyQQ=;
	b=oNREaybpsrliXD4Ua/ex3c6Y+ENOlhClCbtvN7OvzyiHa6q0qXTKsG7r5M8hGmIu/y84
	 Sdn4eNp3gdBXOUyBKGIpCr7mnMgyHhqT0tzzZxthCEMyvZ3mP4CixT8kqu6Pwop/1r+AU
	 KjLON2E3P5Idwhs/s/NteBZPEBo5DrE5tOxOCzu17349uC53lv6QQ74GdrxjhwCaVEs+H
	 qjzaXlMhboJxzYEV1ufglSr/qYUbHHsf/xcRkSaME3T8Nch6WxRF4zE+O2FYNPfq08ubE
	 Gv1tmrzYyXh6PCaeloz2/7ucfVDk4gOdLsdAdiw0Gtw6aJe0adO89ugxYiTlAuV2g1A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KoXkcmF+;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446D3606A320;
	Sun,  8 Nov 2026 08:43:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735871F0089F;
	Sun,  8 Nov 2026 08:43:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794127425;
	bh=NTu6xQo3qc3xPnwGy2quUxpwZu0qheDm9O+kUYdRyQQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=KoXkcmF++9T6/0XVOFsol4pJwoU7/qS1b3TIv6cfZwgm8AADDAUHrwRuyX8HMUusP
	 Bb5eZ6EIYiTjJ7dOSgTtlg04g1YGK/0e3bBrU0VIHEg1Y+nV/CEXkfv0WVg9N9lkMR
	 EbgTjR61i61I8ftIKzprbg3Ypaf/icfWx+kH+jnOAQLe7nz8jbLLVAGzWzazTFNskx
	 /vhABeTpvWHWbMtLb0/Bdcruq0wOx2zFOzCTnJJlU2v1l8Dzx/VB4AJZRsb+tL06dp
	 LDzvmjGlQLmg9yTodJRb3RjWSKlEuheiDeY1+xHpgTMWbN/CeOnIM6RXfXRJh2bfge
	 HCITEm1BPiDtw==
X-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
X-In-Reply-To: <20261104082514.2139278-2-stijncleynhens@gmail.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list