netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: David Miller <davem@davemloft.net>,
	shemminger@linux-foundation.org, nicolas.2p.debian@gmail.com,
	jpirko@redhat.com, xiaosuo@gmail.com, netdev@vger.kernel.org,
	kaber@trash.net, fubar@us.ibm.com, eric.dumazet@gmail.com,
	andy@greyhouse.net, jesse@nicira.com
Subject: Re: [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR
Date: Mon, 23 May 2011 21:20:54 -0700	[thread overview]
Message-ID: <4DDB3226.8010404@candelatech.com> (raw)
In-Reply-To: <m1boyt10n4.fsf@fess.ebiederm.org>

On 05/23/2011 04:02 PM, Eric W. Biederman wrote:
> Ben Greear<greearb@candelatech.com>  writes:
>
>> On 05/23/2011 03:05 PM, Eric W. Biederman wrote:
>>
>> If REORDER_HDR dissappears entirely, I think you have to default to
>> stripping the header on vlan2000.
>
> Which is what patches that started this thread are doing.
>
>>> With vlan hardware acceleration.  When I tcpdump on eth0 I don't
>>> see the vlan header.  Nor do I see the vlan header when I tcpdump
>>> on vlan2000.
>>
>> I think you should see the header on eth0 regardless of hw acceleration
>> or not.  Users should not have to know if their NIC/driver supports
>> vlan tag stripping in one mode or another.
>
> But is it acceptable to fix this in libpcap?

No, because libpcap is not the only thing that opens packet
sockets.  Our user-space network emulator bridges two ethernet
interfaces using packet-sockets.  We have to have the VLAN header
available to properly bridge a VLAN packet out the other side.
It would be possible to use some aux data, but I think that is
a very nasty hack.

Surely we and libpcap are not the only users...

Also, anything using a packet filter might need the header in place.

>>> 3) What do we do with pf_packet and vlan hardware acceleration when
>>>      dumping not the vlan interface but the interface below the vlan
>>>      interface?
>>>
>>>      Do we provide an option to keep the vlan header?  Should that option
>>>      be on by default?
>>
>> At the least we need to have the header kept when using pf_packet on
>> eth0.
>
> Start with the assumption that vlan hardware acceleration is in place
> and the hardware has stripped the vlan tag and put it in skb->tci.
> Sure there are dumb divers out there that don't do this today but
> either we need to throw out vlan hardware acceleration completely
> or emulate it in software because otherwise the test matrix is just
> too big.

It's a binary case..either tag exists in skb or it doesn't.  It might double
the test cases, but that is still a reasonable number.  We should be able
to write a test app to mostly automate testing for that matter.

I still haven't had time to do detailed testing, but I *believe* that
even smart drivers like e1000e and igb don't strip tags if you do not
have any VLANs created on the NIC.  So, sometimes you get tags on
eth0 even when using fancy NICs.

>
>> I think it's best to have it available on vlan2000, but perhaps have it
>> stripped by default for backwards compatibility.
>
> Anything that deals with raw packets pretty much breaks if you don't
> strip the vlan header from visibility on vlan2000.  Plus you loose
> any advantage there is from vlan hardware acceleration, which is
> available on must modern NICs.  So I don't think we can seriously
> consider having the vlan header for present on the vlan2000 device.

I'm fine with stripping them from the vlan2000 frame, though
hopefully one day we can optimize to only do this if there
are actual consumers of the raw packet in user-space.

> All that is interesting is what to do with eth0, and pf_packet sockets.
> And the only question that seems really interesting there is do we put
> the vlan header back on with libpcap magic or with pf_packet logic.
>
> We have to start with a the assumption that we come in with a pf_packet
> with the vlan tag only in skb->tci.

Then I think we should put it back with pf_packet logic.  Possibly with
a per-socket option to disable this and send it as only aux data if that
is more efficient.

If it turns out the NIC is not stripping VLAN tags for whatever reason,
we might be able to optimize things so that it never does the HW emulation
so that it never has to un-do it later.

If we can agree on the desired behaviour, I'll put some effort into
a test system that can test a 4-port system:

eth0 { loopback cable }  eth1 { pf-socket based software bridge } eth2 { looped-back-cable } eth3

Could iterate through a matrix of vlans in various places and test each time to make sure
eth0 and eth3 receive expected data.  I could split the sender/consumer logic into one process
and the bridge into another so that it could be done on two systems with 2 ports each.

Thanks,
Ben

>
> Eric


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2011-05-24  4:21 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
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 [this message]
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=4DDB3226.8010404@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fubar@us.ibm.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 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).