public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	Frank Li <frank.li@nxp.com>,
	"chleroy@kernel.org" <chleroy@kernel.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>
Subject: Re: [PATCH v4 net-next 10/14] net: dsa: netc: introduce NXP NETC switch driver for i.MX94
Date: Thu, 9 Apr 2026 11:07:11 +0300	[thread overview]
Message-ID: <20260409080711.j4kmavt7utef2kil@skbuf> (raw)
In-Reply-To: <AM8PR04MB72840DBFC7F3FD578DFF6AF8885BA@AM8PR04MB7284.eurprd04.prod.outlook.com>

On Wed, Apr 08, 2026 at 11:59:24AM +0300, Wei Fang wrote:
> > > +static int netc_init_switch_id(struct netc_switch *priv)
> > > +{
> > > +	struct netc_switch_regs *regs = &priv->regs;
> > > +	struct dsa_switch *ds = priv->ds;
> > > +
> > > +	/* The value of 0 is reserved for the VEPA switch and cannot
> > > +	 * be used.
> > > +	 */
> > > +	if (ds->index > SWCR_SWID || !ds->index) {
> > > +		dev_err(priv->dev, "Switch index %d out of range\n",
> > > +			ds->index);
> > > +		return -ERANGE;
> > > +	}
> > 
> > Does this check cause the probe to fail unconditionally for standard
> > single-switch topologies?
> > 
> > The DSA core typically assigns ds->index = 0 by default for the first switch.
> > Because !ds->index evaluates to true for index 0, this setup function will
> > always fail unless the dsa,member property is explicitly overridden in the
> > device tree.
> 
> As I mentioned in another mail, we added the 'dsa,member' property to the
> netc switch DT-binding doc, specifying that the 'member' (switch index) value
> cannot be 0. And 'dsa,member' is a required property for netc switch.
> 
> > 
> > Could the driver translate the hardware ID internally, for example by writing
> > ds->index + 1 to NETC_SWCR, rather than forcing this hardware-specific
> > restriction onto the software DSA index?
> 
> The current approach is based on Vladimir's suggestion. I need to confirm with
> Vladimir which approach is better.
> 
> Hi Vladimir,
> 
> What are your thoughts on this suggestion? Is this approach better?

I maintain it is preferable/simpler the way you are doing it, with a 1:1 mapping.
The LLM's concern would be more valid if the switch were discrete and every
board DTS author would have to remember to place the dsa,member property.
But the switch OF node will live in an SoC dtsi.

Maybe you could put something along these lines in the commit message,
hopefully the LLM will pick it up and stop complaining.

  reply	other threads:[~2026-04-09  8:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 11:30 [PATCH v4 net-next 00/14] Add preliminary NETC switch support for i.MX94 Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 01/14] dt-bindings: net: dsa: update the description of 'dsa,member' property Wei Fang
2026-04-08 13:40   ` Rob Herring (Arm)
2026-03-31 11:30 ` [PATCH v4 net-next 02/14] dt-bindings: net: dsa: add NETC switch Wei Fang
2026-04-08 13:43   ` Rob Herring
2026-03-31 11:30 ` [PATCH v4 net-next 03/14] net: enetc: add pre-boot initialization for i.MX94 switch Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  6:55     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 04/14] net: enetc: add basic operations to the FDB table Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  7:04     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 05/14] net: enetc: add support for the "Add" operation to VLAN filter table Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  7:12     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 06/14] net: enetc: add support for the "Update" operation to buffer pool table Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  7:25     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 07/14] net: enetc: add support for "Add" and "Delete" operations to IPFT Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  7:37     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 08/14] net: enetc: add multiple command BD rings support Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 09/14] net: dsa: add NETC switch tag support Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  8:35     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 10/14] net: dsa: netc: introduce NXP NETC switch driver for i.MX94 Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  8:59     ` Wei Fang
2026-04-09  8:07       ` Vladimir Oltean [this message]
2026-03-31 11:30 ` [PATCH v4 net-next 11/14] net: dsa: netc: add phylink MAC operations Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08  9:44     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 12/14] net: dsa: netc: add more basic functions support Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08 11:09     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 13/14] net: dsa: netc: initialize buffer bool table and implement flow-control Wei Fang
2026-04-03  1:17   ` Jakub Kicinski
2026-04-08 11:16     ` Wei Fang
2026-03-31 11:30 ` [PATCH v4 net-next 14/14] net: dsa: netc: add support for the standardized counters Wei Fang

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=20260409080711.j4kmavt7utef2kil@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=chleroy@kernel.org \
    --cc=claudiu.manoil@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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