From: Ben Hutchings <bhutchings@solarflare.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Tom Herbert <therbert@google.com>,
netdev@vger.kernel.org
Subject: Re: net: rps: support 802.1Q
Date: Fri, 19 Aug 2011 12:54:13 +0100 [thread overview]
Message-ID: <1313754853.2814.8.camel@deadeye> (raw)
In-Reply-To: <1313730353-25379-1-git-send-email-xiaosuo@gmail.com>
On Fri, 2011-08-19 at 13:05 +0800, Changli Gao wrote:
> For the 802.1Q packets, if the NIC doesn't support hw-accel-vlan-rx, RPS
> won't inspect the internal 4 tuples to generate skb->rxhash, so this kind
> of traffic can't get any benefit from RPS.
>
> This patch adds the support for 802.1Q to RPS.
[...]
> @@ -2565,6 +2566,13 @@ again:
> addr2 = (__force u32) ip6->daddr.s6_addr32[3];
> nhoff += 40;
> break;
> + case __constant_htons(ETH_P_8021Q):
> + if (!pskb_may_pull(skb, sizeof(*vlan) + nhoff))
> + goto done;
> + vlan = (const struct vlan_hdr *) (skb->data + nhoff);
> + proto = vlan->h_vlan_encapsulated_proto;
> + nhoff += sizeof(*vlan);
> + goto again;
> default:
> goto done;
> }
Should this really be reading an unlimited number of tags? What if an
attacker starts sending packets full of VLAN tags? Since this runs
before netfilter, there would be no way to prevent those packets burning
our CPU time. And if there are legitimately multiple VLAN tags, they
presumably won't all have the 802.1q Ethertype.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-08-19 11:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 5:05 net: rps: support 802.1Q Changli Gao
2011-08-19 5:08 ` David Miller
2011-08-19 5:22 ` Changli Gao
2011-08-19 5:26 ` David Miller
2011-08-19 11:54 ` Ben Hutchings [this message]
2011-08-19 15:05 ` Changli Gao
2011-08-20 1:12 ` Ben Hutchings
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=1313754853.2814.8.camel@deadeye \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=xiaosuo@gmail.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).