Re: [PATCH net-next v4 4/8] net: xilinx: tsn: parse endpoint DMA channel configuration

From: netdev-bot+sashiko

Date: Tue Nov 17 2026 - 08:15:22 EST


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] The driver requires the number of tx_chanN entries in "dma-names"
to equal "xlnx,num-priorities", but the DT binding does not encode or…

--

net: xilinx: tsn: parse endpoint DMA channel configuration

This patch counts the tx_chanN and rx_chanN entries in dma-names and
allocates the conduit netdev with that many TX and RX queues. It parses
the tx-queues-config child node to map each logical TX queue to a TX DMA
channel. Probe also requires the TX channel count to equal
xlnx,num-priorities on the parent IP node.

> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c
> index b6458bb0ba0fd..9458db38255d4 100644
> --- a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c
> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c

[ ... ]

> @@ -69,15 +88,180 @@ static const struct ethtool_ops ep_ethtool_ops = {

[ ... ]

> static int xlnx_tsn_ep_probe(struct platform_device *pdev)
> {

[ ... ]

> + ret = of_property_read_u32(ip_np, "xlnx,num-priorities", &num_prio);
> + of_node_put(ip_np);
> + if (ret)
> + return dev_err_probe(dev, ret, "missing xlnx,num-priorities\n");
> +
> + if (num_prio < TSN_MIN_PRIORITIES || num_prio > TSN_MAX_TX_QUEUE)
> + return dev_err_probe(dev, -EINVAL,
> + "invalid xlnx,num-priorities %u\n",
> + num_prio);
>
> - ndev = alloc_etherdev(sizeof(*ep));
> + if (num_tx_dma_channels != num_prio)
> + return dev_err_probe(dev, -EINVAL,
> + "TX channel count %u must equal num-priorities %u\n",
> + num_tx_dma_channels, num_prio);

[Severity: Low]

Is this equality check stricter than what the binding in
xlnx,tsn-endpoint-ethernet-mac.yaml allows?

The binding says the following and nothing more:

- each dma-names item matches "^(tx|rx)_chan[0-7]$"
- there are 2..16 items, with at least one TX and one RX entry
- each queueN under tx-queues-config maps to a distinct TX channel
listed in dma-names

Taken together, these rules only require the TX channel count to be at
least xlnx,num-priorities. They don't require it to be equal.

For example, this DT looks valid against the schema:

xlnx,num-priorities = <2>;
...
dma-names = "tx_chan0", "tx_chan1", "tx_chan2", "rx_chan0";
tx-queues-config {
queue0 { xlnx,dma-channel-num = <0>; };
queue1 { xlnx,dma-channel-num = <1>; };
};

But xlnx_tsn_ep_probe()->ep_count_dma_channels() counts three TX
channels, and probe then fails with:

TX channel count 3 must equal num-priorities 2

The commit message says equality is the intended rule. Should the binding
state or enforce that in the xlnx,num-priorities or dma-names
descriptions? Or should the driver accept extra TX channels that no queue
uses?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-patches_v2_external-v4-0-56bb26f042a4%40amd.com