[PATCH net v2 1/4] net: stmmac: Fix incorrect location to set real_num_rx|tx_queues

Jose Abreu Jose.Abreu at synopsys.com
Wed Jan 15 08:15:48 PST 2020


From: Ong Boon Leong <boon.leong.ong at intel.com>
Date: Jan/15/2020, 07:10:00 (UTC+00:00)

> From: Aashish Verma <aashishx.verma at intel.com>
> 
> netif_set_real_num_tx_queues() & netif_set_real_num_rx_queues() should be
> used to inform network stack about the real Tx & Rx queue (active) number
> in both stmmac_open() and stmmac_resume(), therefore, we move the code
> from stmmac_dvr_probe() to stmmac_hw_setup().
> 
> Fixes: c02b7a914551 ("net: stmmac: use netif_set_real_num_{rx,tx}_queues")
> Signed-off-by: Aashish Verma <aashishx.verma at intel.com>
> Signed-off-by: Ong Boon Leong <boon.leong.ong at intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 80d59b775907..0780e00580a2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -2624,6 +2624,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
>  	if (priv->dma_cap.vlins)
>  		stmmac_enable_vlan(priv, priv->hw, STMMAC_VLAN_INSERT);
>  
> +	/* Configure real RX and TX queues */
> +	netif_set_real_num_rx_queues(dev, priv->plat->rx_queues_to_use);
> +	netif_set_real_num_tx_queues(dev, priv->plat->tx_queues_to_use);
> +

Nack. You need to hold rtnl lock when calling this and at suspend / resume 
you don't.

---
Thanks,
Jose Miguel Abreu



More information about the linux-arm-kernel mailing list