From: ebiederm@xmission.com (Eric W. Biederman)
To: Changli Gao <xiaosuo@gmail.com>
Cc: "Ben Greear" <greearb@candelatech.com>,
"David Miller" <davem@davemloft.net>,
"Jiri Pirko" <jpirko@redhat.com>,
"Nicolas de Pesloüan" <nicolas.2p.debian@gmail.com>,
netdev@vger.kernel.org, shemminger@linux-foundation.org,
kaber@trash.net, fubar@us.ibm.com, eric.dumazet@gmail.com,
andy@greyhouse.net, "Jesse Gross" <jesse@nicira.com>
Subject: Re: [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR
Date: Sun, 22 May 2011 18:39:06 -0700 [thread overview]
Message-ID: <m1zkmedwlh.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <BANLkTinXFYzzj3R97mKH-90xM64BDwN8aA@mail.gmail.com> (Changli Gao's message of "Mon, 23 May 2011 08:38:36 +0800")
Changli Gao <xiaosuo@gmail.com> writes:
> On Mon, May 23, 2011 at 6:38 AM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
>>
>>> Many years ago we supported the REORDER, but we suggested disabling
>>> it for most users because it was a performance drag. Funny that now
>>> it seems to be the opposite!
>>
>> Yes it is funny. I looked in history a while back and what I saw was
>> that REORDER was always enabled by default and it took some serious
>> effort to figure out how to get vconfig to disable REORDER. ip doesn't
>> admit that REORDER can be disabled at all.
>>
>
> Really?
> Quoted from the manual page of vconfig
> set_flag [vlan-device] 0 | 1
> When 1, ethernet header reorders are turned on. Dumping the
> device will appear as a common ethernet device without vlans.
> When 0(default) however, ethernet headers are not reordered,
> which results in vlan tagged packets when dumping the device.
> Usually the default gives no problems, but some packet filtering
> programs might have problems with it.
>
> reordered is disabled by default. I also concern the performance.
> Untag and then tag are expensive for the NICs which don't support
> hw-accel-vlan-rx/tx.
Yes really the vconfig man page is wrong. Reorder has been enabled
by default since the code was merged. See below.
Dhcp among other things does not work if you disable reorder.
As for performace we are moving 12 bytes which should be cache hot
4 bytes later in what should be the same cache line. I expect my
16Mhz 386 will slow down a little for an operations like that, I
don't expect much else will. I can't see anything short of benchmark
numbers being persuasive.
The other reality is that the code is honestly and truly broken in
the corner cases. If we don't consolidate the code paths it will
never operate correctly.
Not that I agree 100% with all of the decisions but the code has
been broken for a while for most users so we really need to make
it consistent and fix the bugs.
Furthermore to the best of my knowledge no one actually clears
the reorder bit. Changli the fact that you don't know that the
reorder bit is set by default suggest that you don't clear it
in the cases you are concerned about.
If no one is clearing the reorder bit in practice all that we
really have for the vlan changes are code motion and simplification
which should only have a positive impact on performance.
Eric
Aka the vlan code came in at:
commit 15a435fe2c0f649e2879e51e05fa466c2bb12731
Author: torvalds <torvalds>
Date: Tue Feb 5 20:30:01 2002 +0000
v2.4.13.5 -> v2.4.13.6
- me: remember to bump the version number ;)
- Hugh Dickins: export "free_lru_page()" for modules
- Jeff Garzik: don't change nopage arguments, just make the last a dummy one
- David Miller: sparc and net updates (netfilter, VLAN etc)
- Nikita Danilov: reiserfs cleanups
- Jan Kara: quota initialization race
- Tigran Aivazian: make the x86 microcode update driver happy about
hyperthreaded P4's
- me: shrink dcache/icache more aggressively
- me: fix up oom-killer so that it actually works
BKrev: 3c6040c9uewuD0S9AwFCfH3_YMyRHQ
[snip]
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
new file mode 100644
index 0000000..e549e33
--- /dev/null
+++ b/net/8021q/vlan.c
[snip]
+/* DO reorder the header by default */
+unsigned short vlan_default_dev_flags = 1;
[snip]
+/* Attach a VLAN device to a mac address (ie Ethernet Card).
+ * Returns the device that was created, or NULL if there was
+ * an error of some kind.
+ */
+struct net_device *register_802_1Q_vlan_device(const char* eth_IF_name,
+ unsigned short VLAN_ID)
+{
[snip]
+ VLAN_DEV_INFO(new_dev)->vlan_id = VLAN_ID; /* 1 through 0xFFF */
+ VLAN_DEV_INFO(new_dev)->real_dev = real_dev;
+ VLAN_DEV_INFO(new_dev)->dent = NULL;
+ VLAN_DEV_INFO(new_dev)->flags = vlan_default_dev_flags;
[snip]
next prev parent reply other threads:[~2011-05-23 1:39 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 5:48 [patch net-next-2.6 v2] net: vlan: make non-hw-accel rx path similar to hw-accel Jiri Pirko
2011-04-12 21:16 ` David Miller
2011-05-21 1:11 ` Changli Gao
2011-05-21 7:29 ` Jiri Pirko
2011-05-21 10:43 ` Changli Gao
2011-05-21 13:17 ` Nicolas de Pesloüan
2011-05-21 17:54 ` Jesse Gross
2011-05-21 22:15 ` Stephen Hemminger
2011-05-22 2:59 ` Nicolas de Pesloüan
2011-05-22 6:29 ` Jiri Pirko
2011-05-22 6:34 ` Eric W. Biederman
2011-05-22 8:34 ` Nicolas de Pesloüan
2011-05-22 8:52 ` Michał Mirosław
2011-05-22 9:10 ` Nicolas de Pesloüan
2011-05-22 9:20 ` Michał Mirosław
2011-05-22 9:36 ` Jiri Pirko
2011-05-22 9:53 ` Nicolas de Pesloüan
2011-05-22 10:04 ` Michał Mirosław
2011-05-22 16:11 ` Jesse Gross
2011-05-22 18:24 ` Eric W. Biederman
2011-05-22 19:33 ` Eric W. Biederman
2011-05-22 19:39 ` [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR Eric W. Biederman
2011-05-22 19:40 ` [PATCH 2/3] vlan: Always strip the vlan header in vlan_untag Eric W. Biederman
2011-05-22 19:42 ` [PATCH 3/3] vlan: Simplify the code now that VLAN_FLAG_REORDER_HDR is always set Eric W. Biederman
2011-06-09 10:59 ` Jiri Pirko
2011-06-12 6:17 ` Eric W. Biederman
2011-05-22 21:04 ` [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR Ben Greear
2011-05-22 22:38 ` Eric W. Biederman
2011-05-23 0:38 ` Changli Gao
2011-05-23 1:26 ` Changli Gao
2011-05-23 1:45 ` Eric W. Biederman
2011-05-23 2:14 ` Changli Gao
2011-05-23 9:41 ` Eric W. Biederman
2011-05-23 10:43 ` Jiri Pirko
2011-05-23 19:48 ` Nicolas de Pesloüan
2011-05-24 5:58 ` Jiri Pirko
2011-05-24 7:19 ` Nicolas de Pesloüan
2011-05-23 1:39 ` Eric W. Biederman [this message]
2011-05-23 6:01 ` Ben Greear
2011-05-23 9:00 ` Eric W. Biederman
2011-05-23 16:33 ` Ben Greear
2011-05-23 19:36 ` Nicolas de Pesloüan
2011-05-23 20:24 ` Ben Greear
2011-05-23 21:00 ` Stephen Hemminger
2011-05-23 21:20 ` David Miller
2011-05-23 22:05 ` Eric W. Biederman
2011-05-23 22:16 ` Stephen Hemminger
2011-05-23 22:48 ` Eric W. Biederman
2011-05-23 22:23 ` Ben Greear
2011-05-23 23:02 ` Eric W. Biederman
2011-05-24 4:20 ` Ben Greear
2011-05-24 7:11 ` Nicolas de Pesloüan
2011-05-24 7:44 ` Michał Mirosław
2011-05-24 15:17 ` Ben Greear
2011-05-24 5:19 ` David Miller
2011-05-24 7:56 ` Eric W. Biederman
2011-05-24 15:44 ` Ben Greear
2011-05-24 0:11 ` [PATCH] vlan: Fix the b0rked ingress VLAN_FLAG_REORDER_HDR check Eric W. Biederman
2011-05-24 4:54 ` David Miller
2011-05-24 6:18 ` Eric W. Biederman
2011-05-24 6:24 ` David Miller
2011-05-24 7:38 ` Eric W. Biederman
2011-06-02 3:59 ` David Miller
2011-06-02 13:03 ` [PATCH] vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check v2 Eric W. Biederman
2011-06-02 13:15 ` Jiri Pirko
2011-06-02 14:54 ` Changli Gao
2011-06-02 15:26 ` Eric W. Biederman
2011-06-02 23:18 ` Changli Gao
2011-06-06 14:48 ` Jiri Pirko
2011-06-03 3:34 ` padmanabh ratnakar
2011-06-03 3:59 ` Changli Gao
2011-06-05 21:14 ` David Miller
2011-06-10 8:35 ` [PATCH v3] vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check Jiri Pirko
2011-06-10 9:26 ` Changli Gao
2011-06-10 9:34 ` Jiri Pirko
2011-06-10 9:49 ` Changli Gao
2011-06-10 10:35 ` Jiri Pirko
2011-06-10 11:20 ` Changli Gao
2011-06-10 12:12 ` Jiri Pirko
2011-06-10 16:56 ` Jiri Pirko
2011-06-11 0:05 ` Changli Gao
2011-06-11 23:16 ` David Miller
2011-06-08 16:28 ` [PATCH] vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check v2 Jiri Pirko
2011-06-08 23:08 ` Changli Gao
2011-06-09 6:01 ` Jiri Pirko
2011-06-09 11:00 ` [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR Jiri Pirko
2011-05-22 8:38 ` [patch net-next-2.6 v2] net: vlan: make non-hw-accel rx path similar to hw-accel Changli Gao
2011-05-22 9:37 ` Jiri Pirko
2011-05-22 10:17 ` Changli Gao
2011-05-22 10:26 ` Eric W. Biederman
2011-05-22 10:40 ` Changli Gao
2011-05-22 13:16 ` Jiri Pirko
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=m1zkmedwlh.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=fubar@us.ibm.com \
--cc=greearb@candelatech.com \
--cc=jesse@nicira.com \
--cc=jpirko@redhat.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.2p.debian@gmail.com \
--cc=shemminger@linux-foundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.