From: Ben Greear <greearb@candelatech.com>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: andrei radulescu-banu <iubica2@yahoo.com>,
Stephen Hemminger <shemminger@linux-foundation.org>,
Patrick McHardy <kaber@trash.net>,
linux-kernel@vger.kernel.org,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: Linux, tcpdump and vlan
Date: Sat, 21 Jul 2007 10:57:14 -0700 [thread overview]
Message-ID: <46A248FA.1050403@candelatech.com> (raw)
In-Reply-To: <m3sl7idmb4.fsf@maximus.localdomain>
Krzysztof Halasa wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>
>> There is already a flag you can set on vlan devices (reorder-header)
>> that strips the VLAN tag before presenting it to user-space.
>>
>
> Sure, but isn't it only valid for VLAN device (not the main ethX)?
> I.e., can you have the tag stripped from frames captured on ethX?
>
No. I don't see a good reason to strip on ethX. That hardware accel
VLANs strip
is an inconvenience in my opinion, no need to force it in software as well.
>> On tx, if it shows up on the vlan device, we add that device's VID to
>> the header if no VID is currently in the SKB. If it is in the SKB header
>> we change the VID to be the tx dev's VID (if it was different). This allows user-space
>> to send a raw ethernet frame on a vlan device and have it automatically
>> go out of the box on the correct vlan. User-space can also send raw VLAN frames
>> and have those also go out on the correct VLAN.
>>
>
> Well... I think the tag should be added unconditionally (for things like
> QinQ) but that's trivial and minor.
>
I think that for Q in Q, we would need some explicit flag on each skb to
know when to add or modify
the VID. I was never able to think of an automatic solution that worked
in all cases
(bridging, writing raw packets from user space, normal receive, normal
transmit, ...)
Modifying the bridging code would fix that path, and adding a socket opt
to deal with writing
raw packets from user-space should handle the other tricky case I believe.
> IOW: I think all Ethernet interfaces should always be VLAN-aware,
> stripping the tag (only one) early on RX and adding it late on TX.
> That means tcpdump would see packets with exactly one tag removed
> (unless there was no tag), in both RX and TX.
>
> Tcpdump would need other means to get VLAN id...
>
What benefit will this add? It will certainly decrease performance to
copy around
the header for every VLAN packet, so there would have to be a good reason to
add this logic...
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2007-07-21 17:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-19 16:02 Linux, tcpdump and vlan andrei radulescu-banu
2007-07-20 19:58 ` Krzysztof Halasa
2007-07-20 20:34 ` Ben Greear
2007-07-21 11:32 ` Krzysztof Halasa
2007-07-21 17:57 ` Ben Greear [this message]
2007-07-21 21:15 ` Krzysztof Halasa
-- strict thread matches above, loose matches on Subject: below --
2007-07-19 21:38 andrei radulescu-banu
2007-07-19 23:38 ` Ben Greear
2007-07-20 20:19 ` Krzysztof Halasa
2007-07-19 18:20 andrei radulescu-banu
2007-07-19 19:28 ` Stephen Hemminger
2007-07-19 17:46 andrei radulescu-banu
2007-07-19 15:47 andrei radulescu-banu
2007-07-19 16:21 ` Stephen Hemminger
2007-07-19 16:33 ` Patrick McHardy
2007-07-19 16:47 ` Ben Greear
[not found] <878246.51044.qm@web56608.mail.re3.yahoo.com>
2007-07-18 22:57 ` Patrick McHardy
2007-07-18 23:22 ` Ben Greear
2007-07-18 23:34 ` Patrick McHardy
2007-07-19 0:01 ` Ben Greear
2007-07-19 0:19 ` Patrick McHardy
2007-07-19 13:28 ` Krzysztof Halasa
2007-07-19 13:41 ` Stephen Hemminger
2007-07-19 14:00 ` Patrick McHardy
2007-07-19 14:23 ` Krzysztof Halasa
2007-07-19 15:00 ` Stephen Hemminger
2007-07-19 15:45 ` Krzysztof Halasa
2007-07-19 15:20 ` Stephen Hemminger
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=46A248FA.1050403@candelatech.com \
--to=greearb@candelatech.com \
--cc=iubica2@yahoo.com \
--cc=kaber@trash.net \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.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).