Re: [PATCH net-next 1/3] net/stmmac/dwxgmac: Modify DMA functions for future hardware
From: Andrew Lunn
Date: Mon May 11 2026 - 14:21:02 EST
On Mon, May 11, 2026 at 06:54:14PM +0200, Jakub Raczynski wrote:
> Datasheet for newer hardware of XGMAC (3.20a and 3.40a) list support for
> up to 16 DMA/MTL queues. Currently maximum amount of queues in 8 set by
> STMMAC_CH_MAX, MTL_MAX_TX_QUEUES, MTL_MAX_RX_QUEUES macros.
> But before we set these to higher value there are changes to be made.
>
> While newer hardware supports up to 16 MTL/DMA queues, there is support only
> for 8 TC's (traffic control) entries. Current source assumes these are equal,
> which might not be true. While in some cases it would be just incorrect value,
> there are possible wrong memory accesses.
>
> Fix this by saving number of TC supported by hardware in mac_device_info and
> verify it in related functions. Also use TC count rather than MTL_MAX values
> where it applies.
> + /* Newer XGMAC hardware does support up to 16 MTL/DMA queues but
> + * only 8 traffic class queues. Redirect these, but this is error in
> + * configuration.
> + */
If this is an error in configuration why not return -EINVAL when the
configuration is requested?
Andrew