From: Patrick McHardy <kaber@trash.net>
To: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, jeff@garzik.org,
auke-jan.h.kok@intel.com, hadi@cyberus.ca
Subject: Re: [PATCH 3/3] NET: [CORE] Stack changes to add multiqueue hardware support API
Date: Mon, 18 Jun 2007 21:10:09 +0200 [thread overview]
Message-ID: <4676D891.7080107@trash.net> (raw)
In-Reply-To: <20070618184229.12274.88596.stgit@localhost.localdomain>
PJ Waskiewicz wrote:
> Add the multiqueue hardware device support API to the core network
> stack. Allow drivers to allocate multiple queues and manage them
> at the netdev level if they choose to do so.
>
Should be 2/3 and qdisc changes should be 3/3. Well actually the qdisc
sch_generic changes
belong in this patch as well and the qdisc changes should be split in
one change per qdisc.
> /* Functions used for multicast support */
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index e7367c7..8bcd870 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -215,6 +215,7 @@ typedef unsigned char *sk_buff_data_t;
> * @pkt_type: Packet class
> * @fclone: skbuff clone status
> * @ip_summed: Driver fed us an IP checksum
> + * @queue_mapping: Queue mapping for multiqueue devices
> * @priority: Packet queueing priority
> * @users: User count - see {datagram,tcp}.c
> * @protocol: Packet protocol from driver
> @@ -269,6 +270,7 @@ struct sk_buff {
> __u16 csum_offset;
> };
> };
> + __u16 queue_mapping;
>
We have a 4 byte hole on 64 bit after iif where this would fit in.
> @@ -3377,12 +3381,23 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *name,
> if (sizeof_priv)
> dev->priv = netdev_priv(dev);
>
> + alloc_size = (sizeof(struct net_device_subqueue) * queue_count);
> +
> + p = kzalloc(alloc_size, GFP_KERNEL);
> + if (!p) {
> + printk(KERN_ERR "alloc_netdev: Unable to allocate queues.\n");
> + return NULL;
>
Same leak here that you already fixed a couple of posts ago.
> + }
> +
> + dev->egress_subqueue = p;
> + dev->egress_subqueue_count = queue_count;
> +
> dev->get_stats = internal_stats;
> setup(dev);
> strcpy(dev->name, name);
> return dev;
> }
> -EXPORT_SYMBOL(alloc_netdev);
> +EXPORT_SYMBOL(alloc_netdev_mq);
>
> /**
> * free_netdev - free network device
> @@ -3396,6 +3411,7 @@ void free_netdev(struct net_device *dev)
> {
> #ifdef CONFIG_SYSFS
> /* Compatibility with error handling in drivers */
> + kfree((char *)dev->egress_subqueue);
>
And the pointless cast as well.
> if (dev->reg_state == NETREG_UNINITIALIZED) {
> kfree((char *)dev - dev->padded);
> return;
> @@ -3407,6 +3423,7 @@ void free_netdev(struct net_device *dev)
> /* will free via device release */
> put_device(&dev->dev);
> #else
> + kfree((char *)dev->egress_subqueue);
>
And here.
next prev parent reply other threads:[~2007-06-18 19:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-18 18:42 [PATCH] NET: Multiple queue hardware support PJ Waskiewicz
2007-06-18 18:42 ` [PATCH 1/3] NET: [DOC] Multiqueue hardware support documentation PJ Waskiewicz
2007-06-18 18:42 ` [PATCH 2/3] NET: [SCHED] Qdisc changes and sch_rr added for multiqueue PJ Waskiewicz
2007-06-18 19:05 ` Patrick McHardy
2007-06-18 20:36 ` Waskiewicz Jr, Peter P
2007-06-18 20:54 ` Patrick McHardy
2007-06-18 21:04 ` Waskiewicz Jr, Peter P
2007-06-18 21:11 ` Patrick McHardy
2007-06-21 17:55 ` Waskiewicz Jr, Peter P
2007-06-21 18:04 ` Patrick McHardy
2007-06-21 18:12 ` Waskiewicz Jr, Peter P
2007-06-21 18:17 ` Patrick McHardy
2007-06-21 18:23 ` Waskiewicz Jr, Peter P
2007-06-21 19:10 ` Patrick McHardy
2007-06-21 20:15 ` Waskiewicz Jr, Peter P
2007-06-18 18:42 ` [PATCH 3/3] NET: [CORE] Stack changes to add multiqueue hardware support API PJ Waskiewicz
2007-06-18 19:10 ` Patrick McHardy [this message]
2007-06-18 20:26 ` Waskiewicz Jr, Peter P
2007-06-18 20:28 ` Patrick McHardy
2007-06-19 6:28 ` David Miller
2007-06-19 17:31 ` Waskiewicz Jr, Peter P
2007-06-19 20:01 ` Waskiewicz Jr, Peter P
2007-06-19 22:37 ` David Miller
2007-06-19 23:11 ` Waskiewicz Jr, Peter P
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=4676D891.7080107@trash.net \
--to=kaber@trash.net \
--cc=auke-jan.h.kok@intel.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).