๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20861

Re: [PATCH net-next v13 10/14] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support

#20861
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 09:51
138 lines
13344 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] Flow control on the family D SerDes CPU port (port 6) is never
  enabled on the SerDes side.
- [Low] rtl8365mb_sds_probe_option() now sets mb->sds_supported = true
  unconditionally on family D (lines 1467-1469).

--

net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support

This commit extends the RTL8367S SGMII/HSGMII PCS code in rtl8365mb to
cover family D switches. On those chips the CPU SerDes is reached through
the indexed SDS13 window, and the SDS_MISC layout differs from family C.
The family D path uses its own tuning tables, skips pcs_link_up(), and
relies on the MAC forced-mode register that mac_link_up() programs.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 7ad9ef1cbab7d..50ba2fa465808 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -1418,6 +1461,14 @@ static int rtl8365mb_sds_probe_option(struct realtek_priv *priv)
>  	int ret;
>  	int i;
>  
> +	/* Family D has a fixed SDS13 programming model and does not use the
> +	 * family C option register to select its tuning table.
> +	 */
> +	if (rtl8365mb_is_d(priv)) {
> +		mb->sds_supported = true;
> +		return 0;
> +	}
> +

[Severity: Low]
sds_supported is now always true on family D, so rtl8365mb_setup() calls
rtl8365mb_sds_raise_rate_limits() on every family D chip:

rtl8365mb_setup()
    if (mb->sds_supported) {
        ret = rtl8365mb_sds_raise_rate_limits(priv);

That function writes these family C port 6 limiter registers:

  RTL8365MB_INGRESSBW_PORT6_RATE_CTRL0_REG and CTRL1_REG (0x00CF, 0x00D0)
  RTL8365MB_PORT6_EGRESSBW_CTRL0_REG and CTRL1_REG (0x0398, 0x0399)

The commit message checks the RTL8367D vendor API for the bypass line rate
register 0x03F7. Has the same layout been confirmed on family D for these
four registers?

The comment above rtl8365mb_sds_raise_rate_limits() is also unchanged. It
still gives only the family C rationale:

/* The vendor driver raises the port 6 ingress and egress rate limiters to
 * their maximum in its switch init, unconditionally for the whole chip
 * family. The chip reset in rtl8365mb_setup() puts them back to their reset
 * default of 0x1FFFF, ...

Could the comment or the commit message say whether the RTL8367D vendor
API does the same on family D?

[ ... ]

> @@ -2087,18 +2231,21 @@ static void rtl8365mb_phylink_mac_link_up(struct phylink_config *config,
>  			return;
>  		}
>  

[ ... ]

> +		/* Family C: the SerDes has its own pause enables; program
> +		 * them from the resolved pause modes, as the vendor driver
> +		 * does when forcing the link on a SerDes external
> +		 * interface. These bits, not the MAC force pause bits, gate
> +		 * pause on the SerDes external interface: flow control
> +		 * testing shows that pause frames are only emitted with the
> +		 * SerDes TXFC bit set, while the MAC force pause bits alone
> +		 * have no effect on this port. This is done here rather
> +		 * than in rtl8365mb_pcs_link_up() because pcs_link_up()
> +		 * carries no pause information. Family D does not use this
> +		 * path: its pause bits are set in the forced-mode register
> +		 * by rtl8365mb_d_ext_config_forcemode().
>  		 */
> -		if (rtl8365mb_interface_is_serdes(interface)) {
> +		if (rtl8365mb_interface_is_serdes(interface) &&
> +		    !rtl8365mb_is_d(priv)) {
>  			u32 val = 0;
>  
>  			if (tx_pause)

[Severity: Medium]
With this check, does flow control still work on the family D SerDes
port?

The comment above says that on family C the MAC force pause bits alone
have no effect on the SerDes interface. Pause frames are only sent when
the SerDes TXFC bit is set.

On family D, the only pause programming left is the TXPAUSE/RXPAUSE bits.
rtl8365mb_d_ext_config_forcemode() writes them into the MAC force
register.

Nothing else on family D seems to write a SerDes-side pause enable:

- rtl8365mb_pcs_config() sets only PA33PC_EN, PA12PC_EN, MAC6_SEL_SDS0 and
  the mode field in SDS_MISC.
- rtl8365mb_pcs_link_up() returns early.

rtl8365mb_phylink_get_caps() still advertises pause on that port:

	config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
				   MAC_10 | MAC_100 | MAC_1000FD;

Suppose the family D SerDes behaves like family C here. Then phylink would
report pause as enabled, but no PAUSE frames would be sent or honoured on
the CPU link. A 2500base-x CPU port feeding a slower conduit would then
drop frames under congestion instead of applying backpressure.

The commit message mentions only 1G SGMII and 2500base-x link testing.
Was flow control tested on family D? Or does the RTL8367D vendor API show
that the forced-mode pause bits are enough there?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/3f1826f8-3096-40dd-a278-c70fce4852c8%40yahoo.com
Technical Details
Message-ID: <179542749823.3135.12232435194258605468@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369201-linux-kernel-netdev=dewy.ru
References: <04f43ce3-74af-4688-9235-458d21545cc8@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369201-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v13 10/14] net: dsa: realtek: rtl8365mb: add
 family D SDS13 PCS support
Date: Mon, 23 Nov 2026 09:51:38 +0000
Organization: Usenet Network
Message-ID: <179542749823.3135.12232435194258605468@kernel.org>
References: <04f43ce3-74af-4688-9235-458d21545cc8@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3843732"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:poSdQYmSRmIDE0YsSEcsgSFf0xE= sha256:eOBzKEj1/N9SN1FfUrxiSeJsvEPQvAutHDx/iKCdhv4=
	sha1:XiRgeG44FSaDCwlD2dfUmlYgcIs= sha256:AJpHU8fa58AwTCbgw3MYHju8r2kmI29hkzhqp4BU83c=
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 0637A125D9D; Mon, 23 Nov 2026 12:51:58 +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 ydMtnD-CfF4n;
	Mon, 23 Nov 2026 12:51:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369201-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 31E83125D9A; Mon, 23 Nov 2026 12:51:45 +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 21900263C3; Mon, 23 Nov 2026 09:51:43 +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=1795427501;
	b=LuYYVPKvN2i2XXFMm9jG7UtFSV+1mzrMlSAGGJ8SM3pXXEnVMKoSrCJ/ltwHTNP6zOGe
	 cN4+79YxCVYYOoopmwv7nzn4RVAuqyVb1ov5fCsAyDzA+/1YFrr+/woZqYztGjh/gWqPh
	 eL3O7TMzuwSxzKAL/SxlHgY7aarj/yZGILds4SRBam3Fr5o0nIt15O2ENXdjYEHPzqKuT
	 nVvERIzUqHnlsSmJeTj7GnDLhC3DsqsGi4FkNPA3igmhuOxkjdf4A4NCaiQAWXYH+dVfq
	 UksqW7CIuJsyYQqfgSB/TrI41hJ5yFAqtWyqDtelfrlD5zTF92W4vyyFqhI8TGP17NA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795427501;
	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=hRxieL1O5Yz+uBDOAl8S3FzDGEyOjAtfX9xXEMK4ZzM=;
	b=LM6OVyLd1DvxlFnaNw15e0w1+AjzhjuAZLIyAqo4HQFgUrzN10sGSSvqlI8FJCZtBOqZ
	 7I2aDrw74OQkpvQhkAzeoNhNgRj2fehcXInwlNp7lTr0r3U9Ev5u6sklvYybarhCdeRiR
	 hTEkZGuZsmwO8kAHXILtCtAZcxHclEog/N9ObeFyFcd3zGWLTemsxfk7MZ4DT8G/5CO9l
	 1C9oHZhlsSk9DID2R5gyMK1/yBb6KAgLyRkHOIpiDQArNsS/HmGlK987x9jhRLcffAQsJ
	 j0ABOZfh+ImntEcDj863f5Ta4qrh+jfE7taN5nRy33/IGoPFeeBKqsqLlQ2Y7sywVgQ==
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=lRTIO+Ct;
	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 18C7F606A32C;
	Mon, 23 Nov 2026 09:51:41 +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=lRTIO+Ct
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=1795427500;
	b=uOXo/ByDs0e3LYmi1J9yYcZOzFD91/tZC1ec6sfrh6dXI3ObwsYtEm+cxeetsEgDccet
	 yT7lF0oANZdMBazl9Q40xlNaRZTto7SLWdLye8OQapYdmKurmgB49frIYK37fPy0damKz
	 fjPAaAvZf+FoWhy4CJtLIPi9k0OBUv6hgZKTcHlDgB7qXdFp0dGBKMmTQs7jHNSF/uRxH
	 iz13n4xzIFD3XpvqwMwK0S9Vn6fQHhKCQ/AhHklKTpi4Ux29w+mdwymQQBRFxEjxk9jSe
	 +d/LespWQIuqwM8JmmLMLmIbxJp75wgsjSzS4PDQXylLtRwA5wWv5bwI0xxbPzMnbwQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795427500;
	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=hRxieL1O5Yz+uBDOAl8S3FzDGEyOjAtfX9xXEMK4ZzM=;
	b=ns1YkfaLfsk5P0EicpaqLNN27ZL1P2VOcxYdTIwTcyONOjbbHXcR6WHZaTwUBJJF0oEa
	 oOpKVIZIH0FePAlstO2H1EWJMULAB3RXj7T+N8ynvgAqTX9ZGVoQgoInuZ6KdVOvF7hhF
	 zM3CzVt+e8Qe5krBVAxkp8U6FgLk1fZWJgkL263fRtc8QAxT4Luv0mdv3+j6lTodGlhD2
	 ffAlnKGOG+4YMBS0dTEXqe80zmpkIUEzRfGdXphpBAShV+FpPKkokAb/VkYuI9kMnCPpr
	 5IWM3ZqKbKTRjFpsYvBwqxKLWy5SxOM7lZjK/eDZjaeQr/YN1Fz06ODP+j0Sh3EyGZQ==
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=lRTIO+Ct;
	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 38BA2606A686;
	Mon, 23 Nov 2026 09:51:39 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0FC41F000D3;
	Mon, 23 Nov 2026 09:51:38 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795427499;
	bh=hRxieL1O5Yz+uBDOAl8S3FzDGEyOjAtfX9xXEMK4ZzM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=lRTIO+CtmJDUDz7saE2hQYaFQMpx+NhFnK60Y7nFgQK76Jhw+dpQ1KPihcg7ayfFQ
	 SXBx7+JSR3J2as1Hwd5xQzaD6x8/+DiydSrUoOvSSB4RqeQhNfR9X63K/JsPndTYuh
	 c3MFRdIZcWGHoTW9i1E1npIcoqwn7C1/c0sz1zvp1tSwoHzbdERsMPZOSv7SS+EHGu
	 Lu9tNNRgCsSeYqMvjMP9kmxNfVvD2V3sKj0f3J3+CW2ZibeVx9Y1eutBwaPJgSnoE2
	 oPl6Tm7tZnSoxHhZA/Q1vWKSpFlpn+vurJGtVPCngZluMEP/zAnmOu+0qBRY+TR58/
	 t26TmRRp9FinA==
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: <04f43ce3-74af-4688-9235-458d21545cc8@yahoo.com>
X-sashiko-severity: Medium
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