Netdev List
 help / color / mirror / Atom feed
From: Jakub Raczynski <j.raczynski@samsung.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, k.domagalski@samsung.com,
	k.tegowski@samsung.com
Subject: Re: [PATCH net-next 1/3] net/stmmac/dwxgmac: Modify DMA functions for future hardware
Date: Tue, 12 May 2026 10:37:50 +0200	[thread overview]
Message-ID: <agLm3rvbVp4MpHT7@AMDC4622.eu.corp.samsungelectronics.net> (raw)
In-Reply-To: <5b94f49e-5f1a-40fb-af34-f4a9d4738502@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

On Mon, May 11, 2026 at 08:02:14PM +0200, Andrew Lunn wrote:
> > +	/* 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
> 
Because is generally would not change a thing and would probably cause more
problems.

Parent function of stmmac_set_dma_operation_mode() -> stmmac_dma_tx_mode()
does not have any error handling. So we end up in situation where
tx_queues_to_use from DTS is still at its value, so we still have situation
where amount of DMA/MTL queueus is higher than number of TC's.

So then in case of XGMAC 3.20a/3.40a, we would have 8 DMA/MTL queues that
have assigned TC and 8 that don't. I cannot speak for older/other XGMAC if
there were ever a case like that where number of DMA/MTL != number of TC's.

So we will get many unusable MTL queues, eg. NAPI does use tx_queues_to_use in
its initialization, these queues will still be visible in system and can
be sent to. Leaving them unconfigured will very much likely lead to
'Tx queue timeout' and endless loop of interface restart via
stmmac_reset_subtask().

I think it is just simplier to leave warning that configuration is wrong,
handling error would be quite big change to make.

BR
Jakub Raczynski

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2026-05-12  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260511165430eucas1p2d91808b8aa51316842509f19eea4a0a8@eucas1p2.samsung.com>
2026-05-11 16:54 ` [PATCH net-next 0/3] xgmac: Support for 16 MTL/DMA queues Jakub Raczynski
2026-05-11 16:54   ` [PATCH net-next 1/3] net/stmmac/dwxgmac: Modify DMA functions for future hardware Jakub Raczynski
2026-05-11 18:02     ` Andrew Lunn
2026-05-12  8:37       ` Jakub Raczynski [this message]
2026-05-11 16:54   ` [PATCH net-next 2/3] net/stmmac/dwxgmac: Extend MTL/DMA support to 16 queues Jakub Raczynski
2026-05-11 18:05     ` Andrew Lunn
2026-05-12  8:14       ` Jakub Raczynski
2026-05-11 16:54   ` [PATCH net-next 3/3] include/stmmac: Increase max DMA/MTL channel count from 8 to 16 Jakub Raczynski

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=agLm3rvbVp4MpHT7@AMDC4622.eu.corp.samsungelectronics.net \
    --to=j.raczynski@samsung.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=k.domagalski@samsung.com \
    --cc=k.tegowski@samsung.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --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