Subject: Re: [PATCH net-next] net: stmmac: publish actual MTU restriction

From: Jakub Kicinski <[email-masked]>
Date: Fri, 31 Mar 2023 21:52:08 -0700

On Fri, 31 Mar 2023 11:23:44 +0200 Corinna Vinschen wrote:
> Fixes: 2618abb73c895 ("stmmac: Fix kernel crashes for jumbo frames")
> Fixes: a2cd64f30140c ("net: stmmac: fix maxmtu assignment to be within valid range")
> Fixes: ebecb860ed228 ("net: stmmac: pci: Add HAPS support using GMAC5")
> Fixes: 58da0cfa6cf12 ("net: stmmac: create dwmac-intel.c to contain all Intel platform")
> Fixes: 30bba69d7db40 ("stmmac: pci: Add dwmac support for Loongson")

I'm not sure if we need fixes tags for this.
Are any users depending on the advertised values being exactly right?

> +	/* stmmac_change_mtu restricts MTU to queue size.
> +	 * Set maxmtu accordingly, if it hasn't been set from DT.
> +	 */
> +	if (priv->plat->maxmtu == 0) {
> +		priv->plat->maxmtu = priv->plat->tx_fifo_size ?:
> +				     priv->dma_cap.tx_fifo_size;
> +		priv->plat->maxmtu /= priv->plat->tx_queues_to_use;

tx_queues_to_use may change due to reconfiguration, no?
What will happen then?