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:	Fri, 24 Sep 2010 13:24:41 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-net-drivers@...arflare.com, Tom Herbert <therbert@...gle.com>
Subject: Re: [PATCH net-next-2.6 1/2] net: Allow changing number of RX
 queues after device allocation

On Fri, 2010-09-24 at 04:48 +0200, Eric Dumazet wrote:
> Le jeudi 23 septembre 2010 à 21:19 +0100, Ben Hutchings a écrit :
> > For RPS, we create a kobject for each RX queue based on the number of
> > queues passed to alloc_netdev_mq().  However, drivers generally do not
> > determine the numbers of hardware queues to use until much later, so
> > this usually represents the maximum number the driver may use and not
> > the actual number in use.
> > 
> > For TX queues, drivers can update the actual number using
> > netif_set_real_num_tx_queues().  Add a corresponding function for RX
> > queues, netif_set_real_num_rx_queues().
> > 
> > Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
> > ---
> 
> Seems very good to me, except a minor style issue here :
> 
> All functions in this file use a single line.
> 
> > -static int rx_queue_register_kobjects(struct net_device *net)
> > +int
> > +net_rx_queue_update_kobjects(struct net_device *net, int old_num, int new_num)
> 
> ->
> 
> int net_rx_queue_update_kobjects(struct net_device *net, int old, int new)

Why should I rename variables to fit a function signature on one line?

> Also, I dont understand why we need to restrict
> netif_set_real_num_rx_queues() to lower the count.
> This wastes memory.
> 
> Why dont we allocate dev->_rx once we know the real count, not in
> alloc_netdev_mq() but in register_netdevice() ?

We probably could do.  I was just being consistent with
netif_set_real_num_tx_queues().

Note that both functions allow changing the number of queues on a
registered device, although I don't think any driver uses this.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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