From: Patrick McHardy <kaber@trash.net>
To: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: Arkadiusz Miskiewicz <arekm@maven.pl>, netdev@vger.kernel.org
Subject: Re: ~3 hours old git tree: Virtual device lo asks to queue packet!
Date: Thu, 19 Jul 2007 12:11:10 +0200 [thread overview]
Message-ID: <469F38BE.4030401@trash.net> (raw)
In-Reply-To: <469F2E14.9050200@trash.net>
[-- Attachment #1: Type: text/plain, Size: 777 bytes --]
Patrick McHardy wrote:
> Arkadiusz Miskiewicz wrote:
>
>>>>CONFIG_NETDEVICES_MULTIQUEUE=y
>>>
>>>Does it go away if you disable this option?
>>
>>
>>Yes, it goes away after disabling this.
>
>
> I don't see a bug in the code itself, maybe the queue_mapping points
> to an invalid subqueue. Could you please try this patch and post the
> output?
OK I see what the problem is. The loopback device is statically
allocated, so it doesn't have any room for the subqueues reserved.
The easiest fix would be to use egress_subqueue[1] in struct
net_device, but I think that may cause warnings with newer gccs
when using a constant index that is > 0. OTOH using constant
indices doesn't seem to make much sense for the subqueue array.
Arkadiusz, does this patch fix the problem?
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1328 bytes --]
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index da7a13c..bf9399c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -575,7 +575,7 @@ struct net_device
/* The TX queue control structures */
unsigned int egress_subqueue_count;
- struct net_device_subqueue egress_subqueue[0];
+ struct net_device_subqueue egress_subqueue[1];
};
#define to_net_dev(d) container_of(d, struct net_device, dev)
diff --git a/net/core/dev.c b/net/core/dev.c
index 13a0d9f..4af0207 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3619,7 +3619,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
/* ensure 32-byte alignment of both the device and private area */
alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST +
- (sizeof(struct net_device_subqueue) * queue_count)) &
+ (sizeof(struct net_device_subqueue) * (queue_count - 1))) &
~NETDEV_ALIGN_CONST;
alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
@@ -3637,7 +3637,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev->priv = ((char *)dev +
((sizeof(struct net_device) +
(sizeof(struct net_device_subqueue) *
- queue_count) + NETDEV_ALIGN_CONST)
+ (queue_count - 1)) + NETDEV_ALIGN_CONST)
& ~NETDEV_ALIGN_CONST));
}
next prev parent reply other threads:[~2007-07-19 10:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-18 20:18 ~3 hours old git tree: Virtual device lo asks to queue packet! Arkadiusz Miskiewicz
2007-07-18 23:06 ` Patrick McHardy
2007-07-19 6:19 ` Arkadiusz Miskiewicz
2007-07-19 9:25 ` Patrick McHardy
2007-07-19 10:11 ` Patrick McHardy [this message]
2007-07-19 11:52 ` Arkadiusz Miskiewicz
2007-07-19 13:13 ` Patrick McHardy
2007-07-21 2:47 ` David Miller
2007-07-21 3:38 ` Patrick McHardy
2007-07-21 5:33 ` David Miller
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=469F38BE.4030401@trash.net \
--to=kaber@trash.net \
--cc=arekm@maven.pl \
--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 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.