[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1y61x94g1.fsf@fess.ebiederm.org>
Date: Mon, 23 May 2011 02:00:46 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Ben Greear <greearb@...delatech.com>
Cc: David Miller <davem@...emloft.net>, Jiri Pirko <jpirko@...hat.com>,
Nicolas de Pesloüan
<nicolas.2p.debian@...il.com>, Changli Gao <xiaosuo@...il.com>,
netdev@...r.kernel.org, shemminger@...ux-foundation.org,
kaber@...sh.net, fubar@...ibm.com, eric.dumazet@...il.com,
andy@...yhouse.net, Jesse Gross <jesse@...ira.com>
Subject: Re: [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR
Ben Greear <greearb@...delatech.com> writes:
> On 05/22/2011 03:38 PM, Eric W. Biederman wrote:
>> Ben Greear<greearb@...delatech.com> writes:
>>
>>> On 05/22/2011 12:39 PM, Eric W. Biederman wrote:
>>>>
>>>> Simplify the vlan handling code by not supporing clearing of
>>>> VLAN_FLAG_REORDER_HDR. Which means we always make the vlan handling
>>>> code strip the vlan header from the packets, and always insert the vlan
>>>> header when transmitting packets.
>>>>
>>>> Not stripping the vlan header has alwasy been broken in combination with
>>>> vlan hardware accelleration. Now that we are making everything look
>>>> like accelerated vlan handling not stripping the vlan header is always
>>>> broken.
>>>>
>>>> I don't think anyone actually cares so simply stop supporting the broken
>>>> case.
>>>
>>> I've lost track of the VLAN code a bit. Is there any documentation
>>> somewhere about what happens in these various cases:
>>
>> Other than the code I don't know about documentation.
>
> These cases are tricky and probably have changed over
> the years. It would be nice to have it written down
> somewhere, even if just in comments somewhere in the
> VLAN code.
>
>>
>>> * Open a raw packet socket on eth0.
>> I assume you mean a pf_packet socket.
>
> Yes.
>
>>> * Do we get tagged VLAN packets? (I'd expect yes.)
>> yes.
>>
>>> * If we sent a tagged VLAN packet, it's sent without modification? (I'd expect yes.)
>>> ** Without "yes" to the two above, one cannot do user-space bridging properly.
>>
>> This is sort of. If you set the PACKET_AUXDATA option and use recv_cmsg
>> you get the priority and the vlan identifier in the auxdata.
>>
>> I think that is a pretty horrible answer myself but it has been that way
>> since sometime mid 2008. So I'm not immediately prepared to call it
>> a regression, or a bug.
>
> I believe we have been getting tagged VLAN packets properly
> in our test cases. We would not be creating any VLAN devices
> in this case, so perhaps the NIC isn't doing any stripping.
>
> To me, it seems like we should get the fully tagged packet
> without having to go muck with aux-data, though it would
> be fine if it were *also* in aux-data.
Given that pf_packet is a portable interface that works on multiple OS's
I tend to agree. Certainly my users would be happier if they don't
have to change their code and not having to change tcpdump would
also be nice.
I'm not certain exactly where in the code it makes sense to put the
vlan header back on for pf_packet sockets. The simplest thing would
be just before we run the socket filter. If we don't do the simplest
thing this raises the question how do we avoid breaking socket filters
that look at the packet data and know there is going to be a vlan
header there.
Still the current situation is better than seeing vlan 0 tagged packets
twice.
My gut feel says if we can cheaply get the socket filters to act like it
sees the vlan tag (where the vlan tag belongs) we should not actually
put the vlan tag back on until we copy the packet to userspace.
Having the perspective of someone who cares whose hardware supports the
vlan tagging optimizations would be nice to have.
> I'll try to test this again this coming week to make sure
> it's working like I think it is.
Thanks.
Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists