All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gianfar: Allocate the correct number of rx queues in 'gfar_of_init()'
@ 2020-01-26  9:20 ` Christophe JAILLET
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2020-01-26  9:20 UTC (permalink / raw)
  To: claudiu.manoil, davem
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

We can get values for rx and tx queues from "fsl,num_rx_queues" and
"fsl,num_tx_queues". However, when 'alloc_etherdev_mq()' is called, the
value for "tx" is used for both.

Use 'alloc_etherdev_mqs()' instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
WARNING: This patch is purely speculative!

I don't fully understand the code, and tx and rx queues seem to be
allocated by 'gfar_alloc_[rt]x_queues()' and handled with priv-> fields.
I don't know the relationship between queues provided by the core, and the
ones specificly handled in this driver.

'netif_set_real_num_rx_queues()' a few lines below is also spurious to me.
If "fsl,num_rx_queues" > "fsl,num_tx_queues" it will return an error and
things then look out of synch (i.e. 'priv->num_rx_queues' is set to a value
bigger than what is allocated by core, that is to say the one from
'priv->num_tx_queues')

If my assumptions are correct, I guess that the call to
'netif_set_real_num_rx_queues()' is useless


Sorry for the noise if I'm completly wrong.
In such a case, some explanation would be appreciated.
---
 drivers/net/ethernet/freescale/gianfar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 72868a28b621..5e934069682e 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -708,7 +708,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 		return -EINVAL;
 	}
 
-	*pdev = alloc_etherdev_mq(sizeof(*priv), num_tx_qs);
+	*pdev = alloc_etherdev_mqs(sizeof(*priv), num_tx_qs, num_rx_qs);
 	dev = *pdev;
 	if (NULL == dev)
 		return -ENOMEM;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-27 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26  9:20 [PATCH] gianfar: Allocate the correct number of rx queues in 'gfar_of_init()' Christophe JAILLET
2020-01-26  9:20 ` Christophe JAILLET
2020-01-27 11:43 ` Claudiu Manoil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.