Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: namiltd@yahoo.com
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
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	[thread overview]
Message-ID: <179542749823.3135.12232435194258605468@kernel.org> (raw)
In-Reply-To: <04f43ce3-74af-4688-9235-458d21545cc8@yahoo.com>

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

  reply	other threads:[~2026-11-23  9:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3f1826f8-3096-40dd-a278-c70fce4852c8.ref@yahoo.com>
2026-11-22  9:35 ` [PATCH net-next v13 00/14] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-22  9:36   ` [PATCH net-next v13 01/14] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-22  9:37   ` [PATCH net-next v13 02/14] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-22  9:38   ` [PATCH net-next v13 03/14] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-11-22  9:39   ` [PATCH net-next v13 04/14] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-22  9:41   ` [PATCH net-next v13 05/14] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-22  9:42   ` [PATCH net-next v13 06/14] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-11-22  9:43   ` [PATCH net-next v13 07/14] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:44   ` [PATCH net-next v13 08/14] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-11-22  9:45   ` [PATCH net-next v13 09/14] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-11-22  9:46   ` [PATCH net-next v13 10/14] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko [this message]
2026-11-22  9:47   ` [PATCH net-next v13 11/14] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-22  9:48   ` [PATCH net-next v13 12/14] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:49   ` [PATCH net-next v13 13/14] net: dsa: realtek: rtl8365mb: use PCP numbering " Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:50   ` [PATCH net-next v13 14/14] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542749823.3135.12232435194258605468@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alvin.sipraga@analog.com \
    --cc=andrew@lunn.ch \
    --cc=contact@c127.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fabianotassotti@gmail.com \
    --cc=gabonpivovich@gmail.com \
    --cc=gusfmora@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuncy7@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luizluca@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=namiltd@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox