🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17670

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

#17670
From: Linus Walleij
Date: Tue, 17 Nov 2026 08:23
48 lines
11310 bytes
On Tue, Nov 17, 2026 at 8:39 AM 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.
>
> When a vlan_filtering change flips this switch-wide state,
> rtl8365mb_d_vlan_4k_refresh_ivl() updates IVL_EN across the active 4K
> entries, so existing VLANs, including those programmed before filtering
> was enabled, switch between SVL and IVL immediately. Changes that leave
> the state as it is do not touch the table, as the update reads every
> entry.
>
> 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.
>
> Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>

Looks Good To Me (TM)
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij
Technical Details
Message-ID: <CAD++jLmDszU-XBV9bVDH39cYLSKMDOAHEMdu7s8mxYjfhEvuNA@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-365028-linux-kernel-netdev=dewy.ru
References: <cf3fd237-2290-4002-8de0-ea4100ef0f85@yahoo.com> <7edbdf93-91e1-4dd1-9ecf-35863cecc277@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-365028-linux-kernel-netdev=dewy.ru
From: linusw@kernel.org (Linus Walleij)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v11 07/13] net: dsa: realtek: rtl8365mb: set and
 get vlan 4k for family D
Date: Tue, 17 Nov 2026 09:23:33 +0100
Organization: Usenet Network
Message-ID: <CAD++jLmDszU-XBV9bVDH39cYLSKMDOAHEMdu7s8mxYjfhEvuNA@mail.gmail.com>
References: <cf3fd237-2290-4002-8de0-ea4100ef0f85@yahoo.com> <7edbdf93-91e1-4dd1-9ecf-35863cecc277@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2276617"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dXRAFWMu8+c0BLZdMXc28dJhXhc= sha256:zxY25TlO2Zase/AATPkKoH3phkKGZXAaP0AL/SGm8rk=
	sha1:A2LLpl309QdB4bMj5W4YttWDuvg= sha256:FCsvdxE3oFXjYnVAnHslLiBUya5NNBtUX5rSygL+Zmc=
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 E648D114E76; Tue, 17 Nov 2026 11:24:06 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 axO-tptyUW7C;
	Tue, 17 Nov 2026 11:24:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365028-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 572B2114911; Tue, 17 Nov 2026 11:23:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 69641336F6; Tue, 17 Nov 2026 08:23:49 +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=1794903829;
	b=xgjoND/Wm+4jctJMA1EOvjj8ay77Ht+7keUdUdqYKGx0Jg0uxzsqs6n1AmBlSOc6cn6s
	 WTYlzAQzrsoS/Pf2kpsye5Mt7c2RXu7ddjzVOe+GcpRxC2buH0q5IP03WCUHLq6ALJ7Ji
	 ABTeUmS2BgUoBiy7AeZUHNAQMGnOx4V/tGvkKscuItLi9DWCUdZp7dIqu/Z/7gR9e2tUS
	 pWJ03x7zNrll/IeqQEEhnGAhm5OzgBOC8RbiiqbCRYt5YOMW0QMFsrxVWKvTmOtaAoWGz
	 mhsDrHfKtVxyahqFZ+tCaB7Ep2Nl7Re5/OfS6/ZuqzX9nhfKnXdXmJEL0Tt8hMBltNg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794903829;
	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=JufBFXEppaAHOVRYjKH4bmMIJfDMkrcteD8947cV7oA=;
	b=IPqUH5b7F19qFA6nVJw+smV7+z7cKIszBE142QNWXH61C7sGx05oRPfMmcGorgVb1LrK
	 8yop7gpS9voBE/DhsNQafrcdgFlGOtPvNnHSrWqLfAgOmtleAErNC2CvbgPvwHUnyMqAr
	 ZdKCYPqMMlUeTynmkS/3hTnZoRjIHdqScYdI0rFeExsVQBgYPSdJnKpvVoQ0df/dbkeUp
	 VETBtb6N48X+ZCB8aBb7nRX1ddyjxsr46/y2PIt+ggCOIYC+RnkSdV/H9KufXK/ybB+Qb
	 2dHSQPqxZir6IhHpbzoRMXiMvoVuP4HzliPzvyRGjtqtex3BZ+hGFX2qdwDSFsCZvhQ==
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=c5YgioSY;
	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 01A8D606A33B;
	Tue, 17 Nov 2026 08:23:49 +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=c5YgioSY
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=1794903828;
	b=uvEKdlq1XpMUq54oF9NW3S/9i+m5Mgx8ALNSgb7wGX4RZZilQ580YY+UkH+iw97CAIRW
	 fiBYCjckAlCBaCjiOqplgWMo5DccqbScmBcdLkAuxK++7hXe4i5MOISr3GmkvZWhXupzg
	 xk1pKWcH+eRawn7yYZh0WIDporoc9Gh7O2jtMdZRM8o/Ljhd1qpgZiY48GZCgsftToYjz
	 PaVCEhKSGMq5zIjw2Zpv7rly+jqFCnUnNZ6iWuapbyYlpeuYBiGU4sf+sBEBXY0VdvCcP
	 xN9ZJw/2etG2Yj+oyOUuuMJEMnastaNDuXJAyPpPl+oSNSxb8mzhirje6HLlD+zY6Hg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794903828;
	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=JufBFXEppaAHOVRYjKH4bmMIJfDMkrcteD8947cV7oA=;
	b=fap+NHdR49lZ3E7ZSYSHvIaEzsqFjHoeX+XS1MLRHUtYtfpPpRsvf3r5KkZpohA491sz
	 uYk/BNHogzhC+wB0YRx8wGn6wjl2/AhPXY1jiErJ/5cYmk+Oao3i0H+IUVP4kFmshD+6h
	 zdcXOt7BNMAiFuj4Yom7MtnsU1rvAUeWR8JTIPXQEZx0dK916+vgXuEnoriB7qRgFrJwL
	 GiejDXmFCVHPtq14arg2x1gs9qzfE6dH428zi6y/WvM32NcE5B0i/0JiYvP+fb3qRo9DF
	 jAJiMl07gd4jo6+lpYRrCuFx3/VaZoENVpsrl+QqGFZFb4S+bweHT1NC1iwR/n2YjfQ==
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=c5YgioSY;
	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 236AB606A329
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 08:23:47 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B124B1F000CC
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 08:23:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794903827;
	bh=JufBFXEppaAHOVRYjKH4bmMIJfDMkrcteD8947cV7oA=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=c5YgioSY+ksnhJMdq0LObak4F30DHkk+sQGNoaip+dj7IAMnMaVjaA5SUAY17RSZL
	 Gp1buxyWU70zUaxoWBLhS6t7YCMKFJ8kzt4gt6+UP4pi5Tq7o5ZkMcPzj3IeUkzYPy
	 SZ1WB1Y/WrmpFPUWlozcnHINHo9Iunmg16TetT35fcZJ2Mi8xW/CcERzvfSX/uQRwN
	 cRS5heaCFhOz5Jw+zGot3lhTnBJCiDAikEmPOXMZkzL7XrqI/IaEyHVyYRxffOKjDi
	 W3jrV3T8h8cx80ZdTJURiJqdNQJA7riw/4PzrPXui7pRFp3+MPwTGBFoEGEUP2FN6x
	 t4Yk4/FvquQZQ==
X-Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5c14f3dab66so719109e87.0
        for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 00:23:47 -0800 (PST)
X-Forwarded-Encrypted: i=1; AL+hErHWzpa+75G4VGCZfbzlgyE6ct63bJg5XL5omU8kzR50i8Pld5GyY531dpP6H0NudLZrRRSvo1k=@vger.kernel.org
X-Gm-Message-State: APuU4Z/kCqopTvYR6/2Xeyls9F7PpLmB1z8SBZjRJotNXIIJrQyN7Eh0
	8r0Ejq204U4vf9ydD0KuxOV7ZkFG2emfAgXA0aHNZcJo8+oLkx017YCv5QhViV76TWcR/0W1pro
	fSHSHL7gwX+RjAS2tnBtiCVgf8c/rbQ4=
X-Received: by 2002:ac2:4e05:0:b0:5c1:4b7a:958a with SMTP id
 2adb3069b0e04-5c1a0deb485mr655915e87.7.1794903826445; Tue, 17 Nov 2026
 00:23:46 -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: <7edbdf93-91e1-4dd1-9ecf-35863cecc277@yahoo.com>
X-Gmail-Original-Message-ID: <CAD++jLmDszU-XBV9bVDH39cYLSKMDOAHEMdu7s8mxYjfhEvuNA@mail.gmail.com>
X-Gm-Features: Aa3M54oLsBDhpgIbksBhOqzS7n8BEIKk1IqnF7iLZrxpvCBuVRvBTCudDX16xgM
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