netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time
@ 2010-10-04 22:00 John Fastabend
  2010-10-05  5:35 ` Eric Dumazet
  2010-10-07  6:16 ` Eric Dumazet
  0 siblings, 2 replies; 16+ messages in thread
From: John Fastabend @ 2010-10-04 22:00 UTC (permalink / raw)
  To: bhutchings, netdev; +Cc: john.r.fastabend, therbert

The logic for netif_set_real_num_rx_queues is the following,

netif_set_real_num_rx_queues(dev, rxq)
{
	...
	if (dev->reg_state == NETREG_REGISTERED) {
		...
	} else {
		dev->num_rx_queues = rxq;
	}

	dev->real_num_rx_queues = rxq;
	return 0;
}

Some drivers init path looks like the following,

alloc_etherdev_mq(priv_sz, max_num_queues_ever);
...
netif_set_real_num_rx_queues(dev, queues_to_use_now);
...
register_netdev(dev);
...

Because netif_set_real_num_rx_queues sets num_rx_queues if the
reg state is not NETREG_REGISTERED we end up with the incorrect
max number of rx queues. This patch proposes to remove the else
clause above so this does not occur.  Also just reading the
function set_real_num it seems a bit unexpected that num_rx_queues
gets set.

CC: Ben Hutchings <bhutchings@solarflare.com>

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---

 net/core/dev.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index a313bab..f78d996 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1592,8 +1592,6 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
 						  rxq);
 		if (rc)
 			return rc;
-	} else {
-		dev->num_rx_queues = rxq;
 	}
 
 	dev->real_num_rx_queues = rxq;


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

end of thread, other threads:[~2010-10-07  6:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-04 22:00 [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time John Fastabend
2010-10-05  5:35 ` Eric Dumazet
2010-10-05 16:08   ` John Fastabend
2010-10-05 16:34     ` Ben Hutchings
2010-10-05 17:45       ` John Fastabend
2010-10-06 14:52         ` John Fastabend
2010-10-06 15:07           ` Ben Hutchings
2010-10-06 15:20             ` John Fastabend
2010-10-06 15:23             ` Eric Dumazet
2010-10-06 15:31               ` Ben Hutchings
2010-10-06 18:14                 ` Matt Carlson
2010-10-06 18:49                   ` Eric Dumazet
2010-10-06 20:41                     ` David Miller
2010-10-06 15:20           ` Eric Dumazet
2010-10-07  6:16 ` Eric Dumazet
2010-10-07  6:35   ` David Miller

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).