🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15385

Re: [PATCH net-next v10 07/12] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D

#15385
From: Linus Walleij
Date: Thu, 12 Nov 2026 20:25
44 lines
11072 bytes
On Thu, Nov 12, 2026 at 6:37 PM Mieczyslaw Nalewaj <namiltd@yahoo.com> wrote:

> The hardware structure of 4K VLAN table entries has changed between
> silicon families. Family D's CVLAN entry is two 16-bit words rather
> than three: there is no third word extending member/untag past bit 7,
> and no priority/meter fields at all. The FID field is restricted to a
> narrower 2-bit width. The chip itself supports both IVL and SVL.
>
> IVL_EN (bit 3, versus bit 14 on family C) follows vlan4k->ivl_en. On
> family D, rtl8365mb_vlan_4k_port_set() enables it while any user port
> has VLAN filtering enabled (dsa_port_is_vlan_filtering()), so that
> static and learned FDB/MDB entries use the same key. Family C keeps IVL
> always enabled, as before.
>
> The stored IVL_EN is refreshed on the next port_vlan_add/del for the
> VID, not on a vlan_filtering change.
>
> Reusing the three-word family C layout on family D would read a third
> word that does not exist as a distinct table word on family D's die.
> Whatever data happens to be in that register would be folded into
> member/untag bits [10:8] on read, and written back on every
> read-modify-write cycle in rtl8365mb_vlan_4k_port_set(). Give family D
> its own two-word pack/unpack instead: add rtl8365mb_d_vlan_4k_read() and
> rtl8365mb_d_vlan_4k_write(). The shared code reaches them through the
> vlan_4k_read and vlan_4k_write pointers in struct rtl8365mb_family_info,
> so the pack/unpack code needs no is_d() check.
>
> The two-word layout matches the vendor switch API for this chip
> family, which writes only 0x0510/0x0511 for a CVLAN entry.
>
> Nothing points to them until the family D info is added together with
> the chip table entry in the last patch. Until then they are not static
> and are declared in rtl8365mb_vlan.h, so that the build does not warn
> about unused functions.
>
> Tested-by: Gustavo Foletto Mora <gusfmora@gmail.com>
> Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij
Technical Details
Message-ID: <CAD++jL=0AO5o_1vWb284Kw-NRvwzRXM1b38HLHbiBA+m39gS7A@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362203-linux-kernel-netdev=dewy.ru
References: <d9da17af-f49e-4878-a8dd-59a8919e6930@yahoo.com> <915a9103-82e6-4504-8d6e-3d12c4e7af1a@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362203-linux-kernel-netdev=dewy.ru
From: linusw@kernel.org (Linus Walleij)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v10 07/12] net: dsa: realtek: rtl8365mb: set and
 get vlan 4k for family D
Date: Thu, 12 Nov 2026 21:25:51 +0100
Organization: Usenet Network
Message-ID: <CAD++jL=0AO5o_1vWb284Kw-NRvwzRXM1b38HLHbiBA+m39gS7A@mail.gmail.com>
References: <d9da17af-f49e-4878-a8dd-59a8919e6930@yahoo.com> <915a9103-82e6-4504-8d6e-3d12c4e7af1a@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1172833"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rlDTLrd+pPNCHyXs0RQfgvWhZ0k= sha256:pvABqL+J6vz+i2gSZf1xsie6Qfx7RsLb0DPNMddcunc=
	sha1:V7PVpyce4SNQHu2/u92mke0XodQ= sha256:gEbwiFpzZWQjdNUe7T5v5v17MbWevbUt1h3oJyW9TkA=
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 8B97311405D; Thu, 12 Nov 2026 23:42:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 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]
	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 Vmi02ttHZ6eV;
	Thu, 12 Nov 2026 23:42:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-362203-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 97B6611436F; Thu, 12 Nov 2026 23:41:53 +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 34FE66A4FB9; Thu, 12 Nov 2026 20:26:39 +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=1794515167;
	b=1f6CuAKzGij6zCCXaLLs5N5aWjbHGxV0b5LRezf0JwyvagG4MVvDuM9lE2Svyy/WhGU6
	 anRmdrbSEdZI/6sSykxWPTpuef1KLP/9tb3RIMow9xeGgjv8bgFmHYQplaqLoduuubxzu
	 FYycZ5ToweIRvfJwNxkNx3Y1guNvxf3eHnUpoxpDcIjkRFeW/wl7SNUsR9d1Hx8y2tBJ2
	 5MHWS+I0tdxnLljVLjYdQ9Ex0R9+2pKOdsAswbmJlUgSokaVVq59dOrEsq1urx0IqyzCL
	 Vb53u1j3dVG6fwxVVVg/jZZUv8kDhbUe9vSMlsE6DLh40hMoRfXPVqL//MdysN/0meA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794515167;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=JZns9HamMNcZdpHYP/qFBtvpz2do+0TqTxyWCFjtrBo=;
	b=2k0kiOLF3xjqG6qqqSN1cSPcN+6ETEqTnzBy/1uBjOWlBSgn+sB2b7mZLCjHD/Hv+Zhc
	 rPywv/9d8mdGs0haFN/3OoNnPhRHKWI/3Y2ehuGh+d81+NSkJ18l31Fstr5LILJHEzEYQ
	 661S4nPJrSh16wILg2TAS0vT9+cpPXgbCRqWDt2eR03GEekdUt0Pwx2g3azcDUUjQxpaH
	 VdW6F6A5Cnu+19/JF7D972fW/z0ju8D5a223O+SIH8JU8ChA0vL69e7mr0spoQ3id1s9G
	 aOucb6wbKAgbSspdP1ROz4C+nZ5RZp6wDILdRx7sjJgFYvMC/musBk37y7EYAU2QTjQ==
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=ayvBxNnY;
	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 1482D606A33B;
	Thu, 12 Nov 2026 20:26:07 +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=ayvBxNnY
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=1794515166;
	b=c1t4HEqdGU8Zgr0leReyPqmCG5SVNYwxV8UxNtA0VBplpzeeVGCfXCPLmXefK8WNNhix
	 PJOH+3FjOuBNBJUGPYb0QkX+z+eD5ZEybCAwYliwHKXvRN7+TQg3zctaahYZFCAB6yp0W
	 UkoeV2sQ+LtRKNeZurzRC89zNHxhwhfC866433JUUwbQ59Jei03vSVL0liezMqw9thXPH
	 bJVk5Yvz9O/dEtvmIpW1tgw+X9QqrPei8uTTezSVAoQOjifPAHhH61zVsQcIEWOjjmC5l
	 V19XEI91YYNOFk42JOgdncWv/m48c8lbRGHUtx3Gvkh4/ZG8SS6XNQoYdULW8H5y0yA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794515166;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=JZns9HamMNcZdpHYP/qFBtvpz2do+0TqTxyWCFjtrBo=;
	b=Gtqi32UTs9w1dM1glSVTTzIgDiSz57kWuMtGoo39WskoayGdIq7FRT9V+asWme58iFtW
	 f+CjXsgQFDxjoN9W05mdOHIophRr6zcJxSvG8F78JW06WelgTqYgHMDWWt0C/LQrpyOid
	 TQYRADlzpMmoiJ4ZTPa5S+8tcjaXLb3iuEZZnQmOuHqWTn+P3MOBfUPjBPbKpqpZZoVfb
	 N1oYojd65aviIsojG4h9ndSewvKt7gGpFtFLZHt5FNqvISbzDqMPKU2+dyK77qaqS3sCk
	 VtT4HNaKBesMVizlLdhrGmRzabU2iEKHxPAAZ80Z4G/QVaxn0i+UmsV3QUbPBNnWArQ==
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=ayvBxNnY;
	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 30BA1606A331
	for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 20:26:06 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F6A1F000D3
	for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 20:26:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794515165;
	bh=JZns9HamMNcZdpHYP/qFBtvpz2do+0TqTxyWCFjtrBo=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=ayvBxNnYcfw7YYNC9qg6slBeEO0T1T3arnqugFZsmCBXvnvCOEmawy2hpAsEMrWRG
	 owH3E5b0hmwbDAXJdzYkwhfCQYjd7LK+5PWRYjCmAts/3Lt69HybUdOZL2c2jwVv+p
	 qjd0X1FF31/JIPM0tAp9R4iNaBxSwa3XL9abZXDm8MrLlzZjCfszczR8+wDz0J5kqo
	 oTS2AL1Tk9v0e+513akTwTQP4X98WkPT/ryTNkWwcDMV7EhuaTLWIEGA4WCDCn7QNx
	 3CUy1BmsNYe11TMo/KjoZCED4qMa9u5ShrMl16p03FTYWAz07ht2bHqSfneQRT6z4n
	 yBqgLbeuSQh3Q==
X-Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5be3d5927ceso252990e87.3
        for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 12:26:05 -0800 (PST)
X-Forwarded-Encrypted: i=1; AL+hErGoa8KICD16afmt47jRN/OIRNTYrIn4Rg1qjlLSfCWu5ec5yILCSTdPiJFJG+mSfIdqiruN5NM=@vger.kernel.org
X-Gm-Message-State: APuU4Z8bwZ9Pj8CMPlLf/2WnBinLKR0CxQX4MTT5y41T62pdiIjjTlu4
	gP9vovE3hiGcRt06w8e/9VkOcplSxyPnIjjMjeiNsYu1DtUfF2CdZs3FPYZR8DE/q2hu0FD6haL
	BWsYCqgkO/8Ed5PikTvwvdbGf1RjCk+0=
X-Received: by 2002:a05:6512:1048:b0:5c1:5958:a7e4 with SMTP id
 2adb3069b0e04-5c17077eaaemr175815e87.15.1794515164600; Thu, 12 Nov 2026
 12:26:04 -0800 (PST)
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
X-In-Reply-To: <915a9103-82e6-4504-8d6e-3d12c4e7af1a@yahoo.com>
X-Gmail-Original-Message-ID: <CAD++jL=0AO5o_1vWb284Kw-NRvwzRXM1b38HLHbiBA+m39gS7A@mail.gmail.com>
X-Gm-Features: AclHuK_3uCaXSKEUAL81VQhKIbyG96aLPrYBXSXLkRKlO7m5dPPVTgpdDl6W-DY
X-Cc: 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