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  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, 11 Jul 2008 23:19:39 +0200
From:	Eric Dumazet <dada1@...mosbay.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 1/13]: netdev: Allocate multiple queues for TX.

David Miller a écrit :
> alloc_netdev_mq() now allocates an array of netdev_queue
> structures for TX, based upon the queue_count argument.
> 
> Furthermore, all accesses to the TX queues are now vectored
> through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
> interfaces.  This makes it easy to grep the tree for all
> things that want to get to a TX queue of a net device.
> 
> Problem spots which are not really multiqueue aware yet, and
> only work with one queue, can easily be spotted by grepping
> for all netdev_get_tx_queue() calls that pass in a zero index.
> 
> Signed-off-by: David S. Miller <davem@...emloft.net>
> ---

>  	}
>  
> +	tx = kzalloc(sizeof(struct netdev_queue) * queue_count, GFP_KERNEL);
> +	if (!tx) {
> +		printk(KERN_ERR "alloc_netdev: Unable to allocate "
> +		       "tx qdiscs.\n");
> +		kfree(p);
> +		return NULL;
> +	}
> +


On i386 for example, sizeof(struct netdev_queue) = 0x2c

Shouldnt we make sure each queue sits on its own cache line on CONFIG_SMP ?

Also, dev->_tx and dev->num_tx_queues might share a cache line with dev->rx_queue, was it intended ?

> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -640,7 +640,9 @@ struct net_device
>  	unsigned char		broadcast[MAX_ADDR_LEN];	/* hw bcast add	*/
>  
>  	struct netdev_queue	rx_queue;
> -	struct netdev_queue	tx_queue ____cacheline_aligned_in_smp;
> +
> +	struct netdev_queue	*_tx;
> +	unsigned int		num_tx_queues;
>  	unsigned long		tx_queue_len;	/* Max frames per queue allowed */
 



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