From: Oleksij Rempel <o.rempel@pengutronix.de>
To: "Alvin Šipraga" <alvin.sipraga@analog.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Linus Walleij <linusw@kernel.org>,
Luiz Angelo Daros de Luca <luizluca@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de
Subject: Re: [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe the ports of each chip
Date: Mon, 16 Nov 2026 14:36:28 +0100 [thread overview]
Message-ID: <avsG3JcrIQgzxUzN@pengutronix.de> (raw)
In-Reply-To: <avXUEaiSnKsO705y@analog.com>
On Thu, Nov 12, 2026 at 04:08:47PM +0100, Alvin Šipraga wrote:
> On Thu, Nov 12, 2026 at 09:37:48AM +0100, Oleksij Rempel wrote:
> > Record which ports each chip has, report one more than its highest
> > port to DSA as the port count, and reject a devicetree port the chip
> > does not have. Lower the family maximum to 8 to match.
> >
> > Commit ca5ecd4246d4 ("net: dsa: realtek: rtl8365mb: correct the max
> > number of ports") raised the port count of all chips to 11, but no
> > supported chip has a port above 7.
> >
> > Since commit 51a4a22301b0 ("net: dsa: realtek: rtl8365mb: use dsa
> > helpers for port iteration"), setup also programs unused ports, so
> > every probe writes per-port registers of ports 8..10. Their learn-limit
> > writes go to 0x0A28..0x0A2A, above the learn-limit registers of ports
> > 0..7. We have not seen a visible effect from these writes.
>
> I'm not quite sure what the point of the patch is (sorry, maybe it's
> clear later in the series, but I didn't get that far yet). Was the setup
> of nonexistent ports clobbering some other registers?
Not that I could see. I saw no effect from the writes to ports 8..10.
The reason is the rest of the series. The QoS code in the later
patches handles ports 0..7 only. With 11 ports, DSA accepts a
devicetree port 8..10, and the QoS code would then write a register
that does not hold that port's field. With the per-chip port mask, the
driver no longer accepts a port the chip does not have. I reworded the
commit message to say this.
> Also in the blamed commit there was:
>
> -/* RTL8370MB and RTL8310SR, possibly suportable by this driver, have 10 ports */
> -#define RTL8365MB_MAX_NUM_PORTS 10
> +#define RTL8365MB_MAX_NUM_PORTS 11
>
> So maybe it needs bumping in the future if support is added for those
> chips. That's why I'm wondering if you saw something off?
Good point. v3 drops that.
> > dsa_switch_for_each_port(dp, ds) {
> > + if (dsa_port_is_unused(dp))
> > + continue;
>
> You can use dsa_switch_for_each_available_port() here.
Done in v3.
> > +
> > + if (!(mb->chip_info->port_mask & BIT(dp->index))) {
> > + dev_err(priv->dev, "port %d does not exist on %s\n",
> > + dp->index, mb->chip_info->name);
> > + ret = -EINVAL;
> > + goto out_teardown_irq;
> > + }
> > +
Thanks,
Oleksij
next prev parent reply other threads:[~2026-11-16 13:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 8:37 [PATCH net-next v2 00/10] net: dsa: realtek: rtl8365mb: DCB ingress QoS offload Oleksij Rempel
2026-11-12 8:37 ` [PATCH net-next v2 01/10] net: ieee8021q: print traffic type and queue count with %u Oleksij Rempel
2026-11-12 8:37 ` [PATCH net-next v2 02/10] net: ieee8021q: add pcp_to_tt() Oleksij Rempel
2026-11-14 19:56 ` Luiz Angelo Daros de Luca
2026-11-12 8:37 ` [PATCH net-next v2 03/10] net: ieee8021q: clarify the tt_to_tc() traffic-class mapping Oleksij Rempel
2026-11-12 8:37 ` [PATCH net-next v2 04/10] net: ieee8021q: add tt_to_pcp() Oleksij Rempel
2026-11-14 19:59 ` Luiz Angelo Daros de Luca
2026-11-12 8:37 ` [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe the ports of each chip Oleksij Rempel
2026-11-12 15:08 ` Alvin Šipraga
2026-11-16 13:36 ` Oleksij Rempel [this message]
2026-11-12 20:38 ` Linus Walleij
2026-11-15 23:01 ` netdev-bot+sashiko
2026-11-12 8:37 ` [PATCH net-next v2 06/10] net: dsa: realtek: rtl8365mb: store the egress queue count per chip Oleksij Rempel
2026-11-12 8:37 ` [PATCH net-next v2 07/10] net: dsa: realtek: rtl8365mb: add QoS baseline and DCB default prio Oleksij Rempel
2026-11-12 20:31 ` Linus Walleij
2026-11-14 20:15 ` Luiz Angelo Daros de Luca
2026-11-12 8:37 ` [PATCH net-next v2 08/10] net: dsa: realtek: rtl8365mb: program the PCP of untagged frames Oleksij Rempel
2026-11-12 20:33 ` Linus Walleij
2026-11-14 20:18 ` Luiz Angelo Daros de Luca
2026-11-15 23:01 ` netdev-bot+sashiko
2026-11-16 13:49 ` Oleksij Rempel
2026-11-16 14:06 ` Andrew Lunn
2026-11-12 8:37 ` [PATCH net-next v2 09/10] net: dsa: realtek: rtl8365mb: offload DCB apptrust Oleksij Rempel
2026-11-12 20:35 ` Linus Walleij
2026-11-14 20:26 ` Luiz Angelo Daros de Luca
2026-11-12 8:37 ` [PATCH net-next v2 10/10] net: dsa: realtek: rtl8365mb: report the DCB DSCP-to-priority map Oleksij Rempel
2026-11-12 20:36 ` Linus Walleij
2026-11-14 20:28 ` Luiz Angelo Daros de Luca
2026-11-13 12:24 ` [PATCH net-next v2 00/10] net: dsa: realtek: rtl8365mb: DCB ingress QoS offload Alvin Šipraga
2026-11-14 20:39 ` Luiz Angelo Daros de Luca
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=avsG3JcrIQgzxUzN@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=alvin.sipraga@analog.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luizluca@gmail.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
all inboxes | Powered by JetHome®