Subject: Re: [PATCH] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size

From: Jakub Kicinski <[email-masked]>
Date: Mon, 27 Jan 2025 14:06:07 -0800

On Tue, 21 Jan 2025 17:37:03 +0800 Huacai Chen wrote:
> Now for dwmac-loongson {tx,rx}_fifo_size are uninitialised, which means
> zero. This means dwmac-loongson doesn't support changing MTU, 

Please provide more details here than "doesn't support changing".
Does it return an error every time, but the device is operating
correctly?

Do the flow control thresholds also get programmed incorrectly?

> so set the
> correct tx_fifo_size and rx_fifo_size for it (16KB multiplied by channel
> counts).
> 
> Note: the Fixes tag is not exactly right, but it is a key commit of the
> dwmac-loongson series.

Please pick a better one, then. Oldest commit where issue can be
observed by the user is usually a safe choice.

Please use 12 chars of the hash in the tag.

> +	plat->tx_fifo_size = SZ_16K * plat->tx_queues_to_use;
> +	plat->rx_fifo_size = SZ_16K * plat->rx_queues_to_use;

Is this really right? 16k times the number of queues seems like you're
just trying to get the main driver to calculate 16k. 
What if user decreases the queue count? Maybe you should add a way to
communicate the fifo size regardless of the queue count to the main
driver?
-- 
pw-bot: cr