๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16813

Re: [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe the ports of each chip

#16813
From: netdev-bot+sashiko
Date: Sun, 15 Nov 2026 23:01
79 lines
10912 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] This patch lowers RTL8365MB_MAX_NUM_PORTS from 11 to 8.

--

net: dsa: realtek: rtl8365mb: describe the ports of each chip

This commit adds a per-chip port_mask to rtl8365mb_chip_info. It reports
fls(port_mask) to DSA as the port count and rejects devicetree ports that
the chip does not have. It also lowers RTL8365MB_MAX_NUM_PORTS from 11 to
8.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index da06f952a053d..1e6cdc61f6bd3 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> @@ -115,7 +115,7 @@
>  #define RTL8365MB_PHYADDRMAX		7
>  #define RTL8365MB_NUM_PHYREGS		32
>  #define RTL8365MB_PHYREGMAX		(RTL8365MB_NUM_PHYREGS - 1)
> -#define RTL8365MB_MAX_NUM_PORTS		11
> +#define RTL8365MB_MAX_NUM_PORTS		8

[Severity: Low]
This isn't a bug, but is "family maximum" the right description for this
value?

The commit message says:

  Lower the family maximum to 8 to match.

The constant also still sits under this heading:

  /* Family-specific data and limits */

The file header comment still describes the family as having more ports
than that, and it lists the RTL8370MB as a member:

 * In the same family of chips, some carry up to 8 user ports and up to 2
 * extension ports. Where possible this driver tries to make things generic, but
 ...
 *  - RTL8370MB

Some of the family-generic register handling was also written for port
indexes above 7. Examples are the 11-bit RTL8365MB_PORT_MASK, the EXT bit
for the trap port in CPU_CTRL, and the L2 flush code in rtl8365mb_l2.c:

	/* Now issue the flush command and wait for its completion. There are
	 * two registers for this purpose, and which one to use depends on the
	 * port number. The _EXT register is for ports 8 or higher.
	 */
	if (port < 8) {

With this change, 8 looks like the largest port count among the chips the
driver supports, not a limit for the whole family. The BUILD_BUG_ON in
PORT_MASK() reads the same way. So does the later static_assert in this
series that ties RTL8365MB_MAX_NUM_PORTS to RTL8365MB_QOS_MAX_PORTS.

At the end of the series, the header comment and the placement of the
constant are still unchanged.

Would it be clearer to rename the constant to something that marks it as
a driver-supported maximum? Moving it out of the family-limits group and
updating the comment and commit message would also work.

>  /* Valid for the whole family except RTL8370B, which has 4160 entries.
>   * RTL8370B is mentioned in vendor code but it might not even belong
>   * to the same RTL8367C family.

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-rtl8365mb-dcb-ingress-v2-0-f8e6fbdf8c99%40pengutronix.de
Technical Details
Message-ID: <179478369620.3136.10648334333290440373@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363899-linux-kernel-netdev=dewy.ru
References: <20261112-rtl8365mb-dcb-ingress-v2-5-f8e6fbdf8c99@pengutronix.de>

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!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363899-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe
 the ports of each chip
Date: Sun, 15 Nov 2026 23:01:36 +0000
Organization: Usenet Network
Message-ID: <179478369620.3136.10648334333290440373@kernel.org>
References: <20261112-rtl8365mb-dcb-ingress-v2-5-f8e6fbdf8c99@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1923010"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:W0U5F9sqQs+dMqNwlbeFWkeGVzg= sha256:fAsSsjG/eDAQaMCe4BKmfu+8MmQzbdz3c+qg/PLRMFI=
	sha1:OgZq8BITwOwKA9YevrKxnI1UtkE= sha256:MwYVBE1PKWvTHZ36612YgTij+YoHzcyIyKj6NWoTx00=
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 65B80114A93; Mon, 16 Nov 2026 02:01:56 +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 5mNK5KtmyA5f;
	Mon, 16 Nov 2026 02:01:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-363899-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 B86C8114A67; Mon, 16 Nov 2026 02:01:43 +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 AD75B606806; Sun, 15 Nov 2026 23:01:42 +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=1794783698;
	b=ETaWAcWCw8ADP/NHJWUVee7gvu0W8dvyj/A1YRAxNVNmwPU1eh6I7K475bqgGWlzA4vC
	 ELTk70M8lx5eZGkjLKQzNRF4vfwQxwzpm4212b2VRATCOUaidcxemoQ2U1lf6nSoIJCTp
	 uxpnC7Gl4//+pUpYvaoYVo/J0Lgm5ep2MrHCTCYdsm57qqAUX0s20bSTP4HUr7E8dkG3v
	 mPDt+KXfkU6ImaV2dcSmmWtjPUDmU7ewgL+NK9XqFMSp8FymHUGKKP0/MDHCEHgt7EhaW
	 WOLmbT78j2XKeiSVCnBS2bd3tKTpZg8j9NF4062ra9KkozZbWxKEX5HSx/XQ93BSPbg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794783698;
	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=9RKTXa0mNQlc7dJEGQNmec9AiGXENbKZqhKyOZqUSlw=;
	b=0NGCSv8zKaOFty6sQDXPbbbXKaSGk8/Qrdp/NJ3ca9Q9iP8saKtO5eQBcnW3x8IrhjTQ
	 oEMXeA8kvS90z0wMaEkoz6bmxTzcL10Z9llq2UG0vt81C473Uuy2jolj9Co2gYd9Dpe0m
	 QvPJp1aY8vsp5Z2Y2jNAbG9moR/fS5yl9WVBOvc5ccjvGpf9P3sTe2/Z0Oel4LX7FoRtK
	 L0yhmtdRZsL7wF65JVrP2vnbBRMmlR7JCfTRcWwQTfp2TikdA0biMUQ7C8CU9n0/5N8iL
	 4ptrsVDa0ip38ceDbwlbpb90St7LTWVpc9BofrBk7ogM6f7wQjWM8lhUBVvUj/ezvog==
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=YH0FIjmg;
	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 92DCB606A886;
	Sun, 15 Nov 2026 23:01:38 +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=YH0FIjmg
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=1794783697;
	b=ts2A35syhgv1vwEN53z7rOAtUxZ+X6KVKpGvA3zvZ0wccf23H56FnSUlSzXJtmu8vqnq
	 /odLal7ocyzx7VradTEIOWZ0PS75b8OQQFYvr9wCeK/T0v39/NqJDI9MXeW2tvQLo9Qvw
	 A/izWArYhXdak738PANlgXUjUhW2avfZvIaJds/caDt4zVntRKrmF7D3jQKMaqwys0NXM
	 BIkGCSNOwwWXhyrRMh3YKFCUbgf+7b5aHiRKLmxtJGtcyqbFxEAH7gkH0esXw0uZB+M+d
	 4KMmTrza++CioL4q8DiiJ9aATJ6ctGCWl6ZY0S2VpOqI/ZC6uw8unWVShpGEgzmGoRA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794783697;
	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=9RKTXa0mNQlc7dJEGQNmec9AiGXENbKZqhKyOZqUSlw=;
	b=guloqnvBlLXjM20UFWvdQJZd0WuMjgFiK2i0BlX4fvSGMdm8092Q8r6pxxu04gRIRpQN
	 RSkq+W/engzgrLSD6pGGBXqrp4ia+8q6xvtU9yQAPeE7qrEdX3CqgsfAy3weP/5y9wD8V
	 79hjE4/3eH37DN2wEZF6Og9ZwfTIV910WiB9JphwDeCaO6v4Ltby38P0OPJqb1iF8K+j+
	 y/2N0yOXSitvU3TI0Bqav0W/0Xv0kdaayCjO6yeKgPoy/wVuBfcJ59YwSBsx4ShivcOj5
	 bn4EsEacdcGfFMQTUucjMJ4z8ZcJT3dRe1T8jwr1Vp+vYkeFZJjpTkGMrWRaH9AJTXg==
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=YH0FIjmg;
	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 B072E606A32C;
	Sun, 15 Nov 2026 23:01:37 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97D7E1F000CB;
	Sun, 15 Nov 2026 23:01:36 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794783697;
	bh=9RKTXa0mNQlc7dJEGQNmec9AiGXENbKZqhKyOZqUSlw=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=YH0FIjmgCqvZU43dhFqZbEYRGyPV8I0nI6jeXqxq9BpiS6XuitHAUOSJAiZxWafjp
	 FZkdFSpDtfwlPA20XmTb6T6qQaftCpfSwg2nBJmRMysu+FpYVAf7oh0jT86v38fc4m
	 5Bz9mdazY6ykKw7tDd2CxhwR5yB5Fur9yYRkA/+ab9h2nOuccgGzAkveW66o6Ngakj
	 mS+Hdyikk1TXOEshQbDPROR/m+W1EVS+kitfXC6gCoSZ5G45ry2FtB1sc7GttTr/qH
	 PVBzzGjKDEmYj3wtjgXreZ58nYIqthIVAtqdgfkmtXCGMoiM2bFtQL5nMFaAwoyufJ
	 aeal/8mJaB0uw==
X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
 pabeni@redhat.com, horms@kernel.org, linusw@kernel.org, luizluca@gmail.com,
 alvin.sipraga@analog.com, andrew@lunn.ch, olteanv@gmail.com,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de
X-In-Reply-To: <20261112-rtl8365mb-dcb-ingress-v2-5-f8e6fbdf8c99@pengutronix.de>
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