From: ebiederm@xmission.com (Eric W. Biederman)
To: "Jan Grashöfer" <jan.grashoefer@gmail.com>
Cc: netdev@vger.kernel.org, aeppert@gmail.com
Subject: Re: Receiving raw packets (incl. VLAN tags) on raw sockets
Date: Wed, 14 Jun 2017 11:54:25 -0500 [thread overview]
Message-ID: <87o9tq7bni.fsf@xmission.com> (raw)
In-Reply-To: <8e65d057-a39c-6b83-b650-922ba9e86051@gmail.com> ("Jan \=\?utf-8\?Q\?Grash\=C3\=B6fer\=22's\?\= message of "Wed, 14 Jun 2017 18:03:27 +0200")
Jan Grashöfer <jan.grashoefer@gmail.com> writes:
> On 14/06/17 16:41, Eric W. Biederman wrote:
>> That does not work. That is is just the software fallback for when
>> the device driver does not have a special case the processing
>> vlan tagged packets.
>>
>> There was a major inconsistency that for a long time the hardware
>> network drivers were stripping tags and the software ones were not.
>>
>> The code you are playing with is the fix for the rare slow path
>> that does not happen to strip the tags. Disabling the rare slow path
>> might temporarily solve your symptoms but it will be much more painful
>> when you are entrenched in your ways and discover that high performance
>> hardware behaves differently than your software device.
>
> Thanks for your reply! Actually, I was referring to COTS hardware that
> incorporates offloading features. But, when it comes to (security)
> monitoring, offloading is usually disabled [1,2] to process the
> packets as seen on the wire. Thus the "slow path" would be the default
> path for most monitoring applications. That is, what makes this
> situation kind of weird. After turning off the NIC's VLAN offloading,
> it took me some time to realize that now the kernel strips off VLAN
> tags. If someone decides that VLAN offloading is not needed, I think
> the kernel should not enforce it.
In practice it is too too complicated to support both so we choose the
mode where vlan tags are always stripped.
I can imagine a tweak to pf_packet where it readds the vlan tag before
it gets to user space. I can not image changing how we treat the vlan
tags internally to the kernel.
There were nasty kernel bugs before:
bcc6d4790361 ("net: vlan: make non-hw-accel rx path similar to hw-accel")
I don't even want to contemplate opening that can of worms again.
Eric
prev parent reply other threads:[~2017-06-14 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 12:47 Receiving raw packets (incl. VLAN tags) on raw sockets Jan Grashöfer
2017-06-14 14:41 ` Eric W. Biederman
2017-06-14 16:03 ` Jan Grashöfer
2017-06-14 16:54 ` Eric W. Biederman [this message]
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=87o9tq7bni.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=aeppert@gmail.com \
--cc=jan.grashoefer@gmail.com \
--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 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).