Article View: linux.kernel.netdev
Article #17400Re: [PATCH net-next v10 08/12] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 18:55
Date: Mon, 16 Nov 2026 18:55
151 lines
14021 bytes
14021 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 kernel-doc of the new rtl8365mb_vlan_port_reset_pvid()
(drivers/net/dsa/realtek/rtl8365mb_vlan.c) gives two reasons thatβ¦
- [Low] net: dsa: realtek: PVID helpers use rtl8365mb_is_d() instead of
family ops
--
net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D
This patch changes the rtl8365mb PVID helpers so that, on family D, they
use a raw 12-bit VID in the per-port register at 0x0700 + port, because
family D has no VLAN MC table. It also adds
rtl8365mb_vlan_port_reset_pvid(), which rtl8365mb_vlan_setup() calls to
clear the family D PVID registers at setup time. Family C behaviour is
meant to stay the same.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 07e0486060ff0..1c2a998695d6d 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> @@ -2420,6 +2420,15 @@ static int rtl8365mb_vlan_setup(struct dsa_switch *ds)
> int ret;
>
> dsa_switch_for_each_available_port(dp, ds) {
> + /* Start every port with the neutral PVID */
> + ret = rtl8365mb_vlan_port_reset_pvid(priv, dp->index);
> + if (ret) {
> + dev_err(priv->dev,
> + "Failed to reset PVID on port %d\n",
> + dp->index);
> + return ret;
> + }
> +
[Severity: Low]
This still dispatches on rtl8365mb_is_d() inside the family C helpers.
rtl8365mb_vlan_port_get_pvid() now holds two implementations that share
nothing but the signature. rtl8365mb_vlan_pvid_port_set() and
rtl8365mb_vlan_pvid_port_clear() each start with an early return into a
_direct variant. rtl8365mb_vlan_port_reset_pvid() is a no-op unless the
chip is family D.
Luiz raised these points on v7. He asked why rtl8365mb_vlan_setup()
needs a separate reset helper when the PVID clear path already exists.
He asked for rtl8365mb_vlan_port_get_pvid() not to lump both families
into one if/else. He pointed out that VLANMC index 0 is a driver
convention (VID 0) rather than a hardware neutral PVID. He also said
the _direct suffix is not meaningful, and that family-specific
implementations with the same signatures would be cleaner. I don't see
these points addressed or answered in this version.
v10 already moved vlan_4k_read()/vlan_4k_write() and the l2_* entry
converters behind callbacks in struct rtl8365mb_family_info. Could the
PVID get, set, clear and setup-time reset go through the same family
ops, with separate family C and family D functions? That would also
avoid adding another rtl8365mb_is_d() branch to each of these helpers
when the next family shows up.
If there is a reason to keep the branches as they are, could you reply
to the v7 comments or note it in the commit message?
[ ... ]
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_vlan.c b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> index bf1a6a9916114..7d805c6ab5837 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
[ ... ]
> @@ -773,14 +782,51 @@ int rtl8365mb_vlan_port_get_pvid(struct realtek_priv *priv, int port, u16 *pvid)
[ ... ]
> +/**
> + * rtl8365mb_vlan_port_reset_pvid() - Put a port's PVID in its neutral state
> + * @priv: realtek_priv pointer
> + * @port: the port number
> + *
> + * On family C the neutral PVID is VLANMC index 0, which is the reset value, so
> + * there is nothing to do. On family D the PVID is a raw VID in a per-port
> + * register whose value after reset is not defined by the driver (it may come
> + * from the hardware default or from an EEPROM), so clear it to 0.
> + *
> + * Context: Can sleep.
> + * Return: 0 on success, or a negative error code on failure.
> + */
> +int rtl8365mb_vlan_port_reset_pvid(struct realtek_priv *priv, int port)
> +{
> + if (!rtl8365mb_is_d(priv))
> + return 0;
[Severity: Low]
The two halves of this kernel-doc don't seem to agree. Family D gets
cleared because its value after reset "may come from the hardware default
or from an EEPROM". Family C is assumed to be at VLANMC index 0 because
that is "the reset value".
The file header in rtl8365mb_main.c says the EEPROM applies to every chip
the driver handles:
* The EEPROM contains initial register values which the chip will read over I2C
* upon hardware reset. It is also possible to omit the EEPROM.
Both families also use the same PVID register block:
#define RTL8365MB_VLAN_PVID_CTRL_BASE 0x0700
...
#define RTL8365MB_D_VLAN_PVID_CTRL_BASE 0x0700
Is there something that prevents the family C MCIDX fields and VLANMC
entries from being loaded from EEPROM as well?
Suppose a family C EEPROM programs a non-zero MC index and a matching
VLANMC entry. Then rtl8365mb_vlan_setup() leaves it in place, even though
its comment says "Start every port with the neutral PVID". Later:
rtl8365mb_port_vlan_filtering(ds, port, true, ...)
rtl8365mb_vlan_port_get_pvid()
-> returns the stale vlanmc.evid
accepted_frame = RTL8365MB_FRAME_TYPE_ANY_FRAME;
Wouldn't that accept untagged frames on a port the driver never
configured? The commit message gives this same case as the reason to
clear family D.
Family C never cleared these registers before, so "No functional change
for family C" is accurate. The final tree in the series still returns
early here for family C.
Could this either write MC index 0 for family C too (index 0 is
documented as the reserved neutral PVID), or explain in the comment why
the family C PVID registers are known not to be loaded from EEPROM?
> +
> + return regmap_update_bits(priv->map,
> + RTL8365MB_D_VLAN_PVID_CTRL_REG(port),
> + RTL8365MB_D_VLAN_PVID_CTRL_MASK, 0);
> +}
[ ... ]
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/d9da17af-f49e-4878-a8dd-59a8919e6930%40yahoo.com
Technical Details
Message-ID:
<179485535671.3136.12858129949728945036@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364641-linux-kernel-netdev=dewy.ruReferences:
<24c9870b-1991-4817-90a4-e41c5bcac09d@yahoo.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364641-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v10 08/12] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Date: Mon, 16 Nov 2026 18:55:56 +0000 Organization: Usenet Network Message-ID: <179485535671.3136.12858129949728945036@kernel.org> References: <24c9870b-1991-4817-90a4-e41c5bcac09d@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2141988"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ETyDR8WcCRz82PxYbfThspRoG1Q= sha256:HEvh88h/6+I23Bg14PKKV5xSuDujcMbAHmt9WZp3ICg= sha1:58Eurpu/Vy4U7KPqq7zP2BM/7f0= sha256:9uhjM7rbsgvsZlse0mXt1xFZBkb9WnkHDbJb80wj3Wg= 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 36F61114D37; Mon, 16 Nov 2026 21:56:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 SMsdUh-VhgRX; Mon, 16 Nov 2026 21:56:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364641-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id BF9DD114D34; Mon, 16 Nov 2026 21:56:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 2418F29BF0; Mon, 16 Nov 2026 18:56:05 +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=1794855359; b=lMMW97zgNJlxPwEBazSa0TUBScV3+TLXkqyy+dG3n1Dz9gj82nSa+jzYkXNL5PZeUf0J NQu1Ots4TRjjf/Md97V5rfNAWhHGxoHkeRjj/6cnenJJfkT0N6U1ADrTX15GA8fJ5ZB2i VcUc9nSjKHZxR8SiYqk8uQ0wVOQxVkOU0zy89YrkXxdOuQAvw1j1JyXkgWwO3sIfbaagp PHgqbeNp/BCyM3YpLF8OmM6cU7H05yeGctl0cUTvqnNRQpKtVKJVUxq4E8wqbw1uQeQc6 XJBsT2s0Z6/a7yxx4p0hoTa/JFThTpk8fb2DHcTFlfndWe8C4TdCOF+oeeM37y6Wc7A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794855359; 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=e5Ei/FaRzOMLTy8hcSIPrOgugXsKPdaHkiVIDTwmXLM=; b=eObjgOxyzI3m8ysW1uKbR/UkAwAaOdQdVIsrniS4A/Rxv6QHIP8j0XhTbRnhJ0zD877d zMXdFylxnW9RXi3YA+70F8twK0v3YXj3eT859fLOW0p2SVDDldXUiqFwWUDAbpxY8fr0h YOAtD8pjagwJMZlbSnCKTL5SVA4dtFjdlG2kqUAPgP/XcrR/BLKwks3RclPLHgV8fWHO2 KdIyrBUhQ3W15C+kUu/w3+ifh1a6tEDW2WkDDXqsrHvGljz5suiJX1f+IcRUheEn5HD38 faXJk9XhIQyLXyN60oBJTZI4ijepNAbAs+6FaOsAkbzllPk8738r6t9VrNDOcoTzZdQ== 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=S8WmW1CT; 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 66875606A894; Mon, 16 Nov 2026 18:55:59 +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=S8WmW1CT 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=1794855358; b=z0UY7K4LP06ihGGsB7ZFcZVk7eIMJ8bkmW1ICe32hvUyKTYS2YuNtyRqmjC0z8Gzig2j ys7NVmdV3AiZu+WiuJEf4DvPD1UB3aTJAba384Ijf6qjbAgyNK7tew+YqN3P9q5v35+f5 jJkLw6xDWtHaTvyLA7+ppeXq0K1LsFSGlGeyKA91484YPM9HPb4yE6btoBEvCcdInp1TC PYp8hJwkOTRX5EapUafdApRbRFl3o1vo70vPBjHkD/OvmmkCX9jXAZdmrpZIJhuiXB6j1 zsAIU8ZUKytMVMO71fx/l1FsnBNKtpECmMMU8k62tKFBfOkJpVVkIhFqvOc4XafrWbw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794855358; 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=e5Ei/FaRzOMLTy8hcSIPrOgugXsKPdaHkiVIDTwmXLM=; b=ihyRJt76W0GgSDrqKQZV3tBwNA3UMBTxi72orKqe7QbJdAos0sIHVLR88g7G4XokDgL0 Fd9yyNNhDAmiL/we0yGmz8uGM/5W/1umEH7M58lFDwhQHNd201Fl9//jnAODDgOsPFAvL iJLXqFVwWK/J1AwNkpNSt2AQ2iZDAxd2m1dqhQzCgjp9Pc7RYoAupipvdLIf59YM4aM2j nhKBDv9eN44ZxeruupOXcTMAl90l/jQg79Y7eyG0pxr60NgWlpvRZlq2yclpsxjDj5Lj+ KB/PH5E/hzi1boPrToTfopKXmAbPIJ41lPS9atAmehJ81bE13PwSUbpYUbesFxEnZmg== 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=S8WmW1CT; 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 8823D606A881; Mon, 16 Nov 2026 18:55:58 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A1611F000C4; Mon, 16 Nov 2026 18:55:57 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794855358; bh=e5Ei/FaRzOMLTy8hcSIPrOgugXsKPdaHkiVIDTwmXLM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=S8WmW1CTSBiLGU2JSR9WDm22omk7GyLKNJEtcWINNG/jVYBdkdIHXwrH6qYfuD8/+ 94Zz9FtlqYiE1eSF14oSrYIXDNsN6/4WFqH9atA3mL5aEu53i0OecgnMvXiF75TpQX 1l+VvblRfPA9eKNPBrDDiRDbIQZEt/vxzZ/+cKm4SJqY1BRHpfOlYJBhKQQ/xSaVGl NS0gX939YtONC+wC3vJSNpt9LU3baEr7WK5Ns3CXTTus1aEQeLgahsvJNS5durV2UZ j6hmz6HgLllZWh3Jj4xcSKG3dNStFnnDhBZwUDYF+wB8eBsDEOkzcyM3Vyk2qZH0fW MKFAcdl1MfxUg== X-Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alvin.sipraga@analog.com, gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com, gabonpivovich@gmail.com, contact@c127.dev X-In-Reply-To: <24c9870b-1991-4817-90a4-e41c5bcac09d@yahoo.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