Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: srinivas.neeli@amd.com
Cc: nagadheeraj.rottela@amd.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	richardcochran@gmail.com, michal.simek@amd.com,
	bigeasy@linutronix.de, clrkwllms@kernel.org, rostedt@goodmis.org,
	edumazet@kernel.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rt-devel@lists.linux.dev, neelisrinivas18@gmail.com,
	git@amd.com
Subject: Re: [PATCH net-next v3 3/8] net: xilinx: tsn: add endpoint MAC driver skeleton
Date: Tue, 20 Oct 2026 11:58:14 +0000	[thread overview]
Message-ID: <179249749490.3135.16050500473575890674@kernel.org> (raw)
In-Reply-To: <20261016-patches_v2_external-v3-3-e33d3960ca1e@amd.com>

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] xlnx_tsn_ep_probe() in
  drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c (line 80) open-codes…

--

net: xilinx: tsn: add endpoint MAC driver skeleton

This adds a platform driver for the "xlnx,tsn-ep-mac" endpoint MAC. The
endpoint MAC provides the conduit netdev for the TSN DSA switch. The driver
registers an eth%d netdev, sets its MAC address from DT or a random one,
and provides minimal netdev/ethtool ops where xmit just drops frames.

> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c
> new file mode 100644
> index 0000000000000..609d444c68356
> --- /dev/null
> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c

[ ... ]

> +static int xlnx_tsn_ep_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct net_device *ndev;
> +	struct xlnx_tsn_ep *ep;
> +	u8 mac_addr[ETH_ALEN];
> +	int ret;
> +
> +	ndev = alloc_netdev(sizeof(*ep), "eth%d", NET_NAME_UNKNOWN, ether_setup);

[Severity: Low]
Should this be NET_NAME_ENUM rather than NET_NAME_UNKNOWN?

With the "eth%d" template the kernel chooses the number. The standard
helper for that case uses NET_NAME_ENUM:

net/ethernet/eth.c:alloc_etherdev_mqs() {
	return alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_ENUM,
				ether_setup, txqs, rxqs);
}

The DSA user port fallback in dsa_user_create() in net/dsa/user.c also
pairs "eth%d" with NET_NAME_ENUM. The v2 changelog gave that as its reason.

With NET_NAME_UNKNOWN, reading /sys/class/net/ethX/name_assign_type for
this device returns -EINVAL:

net/core/net-sysfs.c:name_assign_type_show() {
	...
	if (READ_ONCE(ndev->name_assign_type) != NET_NAME_UNKNOWN)
		ret = netdev_show(dev, attr, buf, format_name_assign_type);
	...
}

Netdevs from alloc_etherdev() and the DSA user netdevs stacked on top of
this conduit report 1 there.

The v3 changelog says:

  "Register the netdev with the standard eth%d name (NET_NAME_UNKNOWN)"

That doesn't match what the standard helper does. Would alloc_etherdev()
work here instead? It would also drop the open-coded ether_setup.

Later in the series, "net: xilinx: tsn: parse endpoint DMA channel
configuration" changes this call to alloc_netdev_mqs(sizeof(*ep), "eth%d",
NET_NAME_UNKNOWN, ether_setup, ...) and still uses NET_NAME_UNKNOWN.
alloc_etherdev_mqs() would cover that multi-queue version.

> +	if (!ndev)
> +		return -ENOMEM;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016-patches_v2_external-v3-0-e33d3960ca1e%40amd.com


  reply	other threads:[~2026-10-20 11:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  9:31 [PATCH net-next v3 0/8] Add Xilinx TSN Endpoint Ethernet MAC driver Srinivas Neeli
2026-10-16  9:32 ` [PATCH net-next v3 1/8] dt-bindings: net: add Xilinx TSN Endpoint Ethernet MAC Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 2/8] net: xilinx: tsn: add TSN endpoint wrapper driver Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 3/8] net: xilinx: tsn: add endpoint MAC driver skeleton Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko [this message]
2026-10-16  9:32 ` [PATCH net-next v3 4/8] net: xilinx: tsn: parse endpoint DMA channel configuration Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 5/8] net: xilinx: tsn: bring up the endpoint MCDMA channels Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 6/8] net: xilinx: tsn: add the endpoint RX data path Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 7/8] net: xilinx: tsn: add the endpoint TX " Srinivas Neeli
2026-10-20 11:58   ` netdev-bot+sashiko
2026-10-16  9:32 ` [PATCH net-next v3 8/8] net: xilinx: tsn: deliver endpoint RX frames to DSA user ports Srinivas Neeli
2026-10-20 11:58   ` 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=179249749490.3135.16050500473575890674@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=git@amd.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=michal.simek@amd.com \
    --cc=nagadheeraj.rottela@amd.com \
    --cc=neelisrinivas18@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=srinivas.neeli@amd.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