From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/13]: netdev: Allocate multiple queues for TX.
Date: Fri, 11 Jul 2008 23:19:39 +0200 [thread overview]
Message-ID: <4877CE6B.2050805@cosmosbay.com> (raw)
In-Reply-To: <20080710.035610.167480342.davem@davemloft.net>
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@davemloft.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 */
next prev parent reply other threads:[~2008-07-11 21:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 10:56 [PATCH 1/13]: netdev: Allocate multiple queues for TX David Miller
2008-07-11 21:19 ` Eric Dumazet [this message]
2008-07-15 9:45 ` David Miller
2008-07-16 7:01 ` Jarek Poplawski
2008-07-16 7:37 ` David Miller
2008-07-16 8:00 ` Jarek Poplawski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4877CE6B.2050805@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.