From: John Fastabend <john.r.fastabend@intel.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Peter Lieven <pl@dlh.net>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: RFS seems to have incompatiblities with bridged vlans
Date: Mon, 07 Jun 2010 15:30:42 -0700 [thread overview]
Message-ID: <4C0D7312.1020300@intel.com> (raw)
In-Reply-To: <20100607145910.2458ac87@nehalam>
Stephen Hemminger wrote:
> On Mon, 7 Jun 2010 22:36:11 +0200
> Peter Lieven <pl@dlh.net> wrote:
>
>> Hi,
>>
>> i today tried out 2.6.32-rc2 and I see a lot of warning messages like this:
>>
>> Jun 7 22:33:15 172.21.55.20 kernel: [ 3012.575884] br141 received packet on queue 4, but number of RX queues is 1
>>
>> The host is a SMP system with 8 cores, so I think there is expected to be one rx queue per CPU, but it seems
>> the bridge iface has only one.
>>
>
> The bridge interface has no queues. It doesn't queue any packets.
> The test in receive packet path is not appropriate in this case.
> Not sure what the right fix is. Pretending the bridge device has
> multiple queues (num_queues == NUM_CPUS) is a possibility but
> seems like overhead without real increase in parallelism.
>
>
>
There is always a possibility that the underlying device sets the
queue_mapping to be greater then num_cpus. Also I suspect the same
issue exists with bonding devices. Maybe something like the following
is worth while? compile tested only,
[PATCH] 8021q: vlan reassigns dev without check queue_mapping
recv path reassigns skb->dev without sanity checking the
queue_mapping field. This can result in the queue_mapping
field being set incorrectly if the new dev supports less
queues then the underlying device.
This patch just resets the queue_mapping to 0 which should
resolve this issue? Any thoughts?
The same issue could happen on bonding devices as well.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/8021q/vlan_core.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index bd537fc..ad309f8 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -21,6 +21,9 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct
vlan_group *grp,
if (!skb->dev)
goto drop;
+ if (unlikely(skb->queue_mapping >= skb->dev->real_num_tx_queues))
+ skb_set_queue_mapping(skb, 0);
+
return (polling ? netif_receive_skb(skb) : netif_rx(skb));
drop:
@@ -93,6 +96,9 @@ vlan_gro_common(struct napi_struct *napi, struct
vlan_group *grp,
if (!skb->dev)
goto drop;
+ if (unlikely(skb->queue_mapping >= skb->dev->real_num_tx_queues))
+ skb_set_queue_mapping(skb, 0);
+
for (p = napi->gro_list; p; p = p->next) {
NAPI_GRO_CB(p)->same_flow =
p->dev == skb->dev && !compare_ether_header(
next prev parent reply other threads:[~2010-06-07 22:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 20:36 RFS seems to have incompatiblities with bridged vlans Peter Lieven
2010-06-07 21:59 ` Stephen Hemminger
2010-06-07 22:19 ` Eric Dumazet
2010-06-07 22:30 ` John Fastabend [this message]
2010-06-07 23:13 ` John Fastabend
2010-06-08 14:18 ` Eric Dumazet
2010-06-08 23:00 ` Tom Herbert
2010-06-08 23:58 ` Tim Gardner
2010-06-09 1:08 ` John Fastabend
2010-06-09 1:52 ` Tom Herbert
2010-06-09 4:42 ` Eric Dumazet
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=4C0D7312.1020300@intel.com \
--to=john.r.fastabend@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=pl@dlh.net \
--cc=shemminger@vyatta.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).