From: Furong Xu <0x1207@gmail.com>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 2/2] net: stmmac: Limit the number of MTL queues to maximum value
Date: Thu, 16 Jan 2025 11:28:14 +0800 [thread overview]
Message-ID: <20250116112814.00005bef@gmail.com> (raw)
In-Reply-To: <20250116020853.2835521-2-hayashi.kunihiko@socionext.com>
On Thu, 16 Jan 2025 11:08:53 +0900, Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
> The number of MTL queues to use is specified by the parameter
> "snps,{tx,rx}-queues-to-use" from the platform layer.
>
> However, the maximum number of queues is determined by
> the macro MTL_MAX_{TX,RX}_QUEUES. It's appropriate to limit the
> values not to exceed the upper limit values.
>
The Fixes: tag is required too.
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index ad868e8d195d..471eb1a99d90 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -165,6 +165,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
> if (of_property_read_u32(rx_node, "snps,rx-queues-to-use",
> &plat->rx_queues_to_use))
> plat->rx_queues_to_use = 1;
> + if (plat->rx_queues_to_use > MTL_MAX_RX_QUEUES)
> + plat->rx_queues_to_use = MTL_MAX_RX_QUEUES;
MTL_MAX_RX_QUEUES, MTL_MAX_TX_QUEUES and STMMAC_CH_MAX are defined to 8,
this is correct for gmac4, but xgmac has 16 channels at most.
Drop these legacy defines and always use
priv->dma_cap.number_rx_queues,
priv->dma_cap.number_tx_queues,
priv->dma_cap.number_tx_channel,
priv->dma_cap.number_rx_channel,
seems like a good option.
>
> if (of_property_read_bool(rx_node, "snps,rx-sched-sp"))
> plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP;
> @@ -224,6 +226,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
> if (of_property_read_u32(tx_node, "snps,tx-queues-to-use",
> &plat->tx_queues_to_use))
> plat->tx_queues_to_use = 1;
> + if (plat->tx_queues_to_use > MTL_MAX_TX_QUEUES)
> + plat->tx_queues_to_use = MTL_MAX_TX_QUEUES;
>
> if (of_property_read_bool(tx_node, "snps,tx-sched-wrr"))
> plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WRR;
next prev parent reply other threads:[~2025-01-16 3:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 2:08 [PATCH net 1/2] net: stmmac: Limit FIFO size by hardware feature value Kunihiko Hayashi
2025-01-16 2:08 ` [PATCH net 2/2] net: stmmac: Limit the number of MTL queues to maximum value Kunihiko Hayashi
2025-01-16 3:28 ` Furong Xu [this message]
2025-01-16 10:02 ` Kunihiko Hayashi
2025-01-16 3:04 ` [PATCH net 1/2] net: stmmac: Limit FIFO size by hardware feature value Furong Xu
2025-01-16 10:02 ` Kunihiko Hayashi
2025-01-16 20:16 ` Andrew Lunn
2025-01-20 5:20 ` Kunihiko Hayashi
2025-01-20 16:29 ` Andrew Lunn
2025-01-21 0:17 ` Kunihiko Hayashi
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=20250116112814.00005bef@gmail.com \
--to=0x1207@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).