From: Patrick McHardy <kaber@trash.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Benny Amorsen <benny+usenet@amorsen.dk>,
Gertjan Hofman <gertjan_hofman@yahoo.com>,
Matt Carlson <mcarlson@broadcom.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] vlan: allow VLAN ID 0 to be used
Date: Wed, 28 Oct 2009 17:13:26 +0100 [thread overview]
Message-ID: <4AE86DA6.40408@trash.net> (raw)
In-Reply-To: <4AE6C54B.7080805@gmail.com>
Eric Dumazet wrote:
> Benny Amorsen a écrit :
>> Eric Dumazet <eric.dumazet@gmail.com> writes:
>>
>>> Here is the patch I cooked that permitted VLAN 0 to be used with tg3
>>> (and other HW accelerated vlan nics I suppose)
>>>
>>> [PATCH] vlan: allow VLAN ID 0 to be used
>>>
>>> We currently use a 16 bit field (vlan_tci) to store VLAN ID on a skb.
>>>
>>> 0 value is used a special value, meaning VLAN ID not set.
>>> This forbids use of VLAN ID 0
>> Are you sure you actually want to do this?
>>
>> VLAN 0 IS special. Frames received on VLAN 0 should be treated just as
>> if they had no VLAN tag at all, except that they have an 802.1p value.
>>
>> Sending frames with VLAN 0 should have something to do with whether
>> the sender wants to use 802.1p, which doesn't really have much to do
>> with VLAN's at all...
>>
>> It would be nice if the unsuspecting user was at least warned that their
>> use of VLAN 0 is non-standard and may cause surprising results like
>> leakage into the "native" VLAN. That could be done in /sbin/ip or
>> /sbin/vconfig, of course.
>>
>
> Quotting http://en.wikipedia.org/wiki/IEEE_802.1Q
>
> VLAN Identifier (VID): a 12-bit field specifying the VLAN to which the frame belongs.
> A value of 0 means that the frame doesn't belong to any VLAN; in this case the 802.1Q
> tag specifies only a priority and is referred to as a priority tag.
> A value of hex FFF is reserved for implementation use.
> All other values may be used as VLAN identifiers, allowing up to 4094 VLANs
>
>
> So we expect to generate a 802.1Q frame, even with a VID=0 field.
> Before patch, device sends a non 802.1Q frame, which is not what was wanted by user.
> (Maybe he wants to check its device/network is able to transport 1522 bytes frames, who knows...)
>
> To use non tagged frames, user selects eth0 device, and to send tagged frames, he selects eth0.0
I agree. Quoting IEEE802.1Q:
0 The null VLAN ID. Indicates that the tag header contains only priority
information; no VLAN identifier is present in the frame. ...
which implies that its valid to use 0 as tag in the header.
> Now, maybe eth0 and eth0.0 should share same IP addresses, because incoming frame
> with ID=0 tag should be received by eth0 device, but I am not sure standard requires this.
I don't think the standard makes any demands regarding this.
The current behaviour seems better to me since its symetrical
to the output path, where the VLAN device is necessary to be
able to specify a priority mapping.
prev parent reply other threads:[~2009-10-28 16:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-26 4:30 VLAN and ARP failure on tg3 drivers Gertjan Hofman
2009-10-26 8:20 ` Benny Amorsen
2009-10-26 8:54 ` Eric Dumazet
2009-10-26 16:13 ` [PATCH] vlan: allow VLAN ID 0 to be used Eric Dumazet
2009-10-27 0:32 ` David Miller
2009-10-27 1:34 ` Eric Dumazet
2009-10-27 1:41 ` David Miller
2009-10-27 9:52 ` Benny Amorsen
2009-10-27 10:02 ` Eric Dumazet
2009-10-28 16:13 ` Patrick McHardy [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=4AE86DA6.40408@trash.net \
--to=kaber@trash.net \
--cc=benny+usenet@amorsen.dk \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gertjan_hofman@yahoo.com \
--cc=mcarlson@broadcom.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).