lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101004220042.3471.92774.stgit@jf-dev1-dcblab>
Date:	Mon, 04 Oct 2010 15:00:42 -0700
From:	John Fastabend <john.r.fastabend@...el.com>
To:	bhutchings@...arflare.com, netdev@...r.kernel.org
Cc:	john.r.fastabend@...el.com, therbert@...gle.com
Subject: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap
	num_rx_queues at init time

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@...arflare.com>

Signed-off-by: John Fastabend <john.r.fastabend@...el.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;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ