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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 03 Dec 2009 16:17:43 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jarek Poplawski <jarkao2@...il.com>
CC:	David Miller <davem@...emloft.net>, mchan@...adcom.com,
	kaber@...sh.net, netdev@...r.kernel.org
Subject: Re: [PATCH v2] net: Introduce realloc_netdev_mq()

Jarek Poplawski a écrit :
> Take 2 (with forgotten headers, sorry).

Very nice, thanks !

> Here is a proposal of netdev api change. I hope Michael finds time
> to try if this can be really useful for drivers.
> 
> Thanks,
> Jarek P.
> ---------------> (take 2)
> 
> This patch separates allocation of TX subqueues from alloc_netdev_mq()
> to realloc_netdev_mq() to allow for resizing like in this example:
> 
> some_nic_probe()
> {
> 	...
> 	dev = alloc_etherdev_mq(sizeof(*bp), 1)
> 	...
> 	if (MSI-X_available && device_supports_MSI-X_and_multiqueue)
> 		realloc_netdev_mq(dev, TX_MAX_RINGS)
> 	register_netdev(dev)
> 	...
> }
> 

Or the reverse :

ie, the device first allocate its max possible tx rings

dev = alloc_etherdev_mq(sizeof(*bp), 128)

then, later, try to reduce it, when knowing exact tx count.

if (realloc_netdev_mq(dev, real_queues))
	dev->real_num_tx_queues = real_queues;

In this case the memory error is not fatal.
--
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