Subject: Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel

From: Nicolas de Pesloüan<[email-masked]>
Date: Sun, 03 Apr 2011 11:27:29 +0200

Le 02/04/2011 20:27, Jiri Pirko a écrit :
> Sat, Apr 02, 2011 at 05:55:24PM CEST, [email-masked] wrote:
>> On Sat,  2 Apr 2011 12:26:06 +0200
>> Jiri Pirko<[email-masked]>  wrote:
<snip>
>>> +	rawp = skb->data;
>>> +	if (*(unsigned short *) rawp == 0xFFFF)
>>> +		/*
>>> +		 * This is a magic hack to spot IPX packets. Older Novell
>>> +		 * breaks the protocol design and runs IPX over 802.3 without
>>> +		 * an 802.2 LLC layer. We look for FFFF which isn't a used
>>> +		 * 802.2 SSAP/DSAP. This won't work for fault tolerant netware
>>> +		 * but does for the rest.
>>> +		 */
>>> +		skb->protocol = htons(ETH_P_802_3);
>>> +	else
>>> +		/*
>>> +		 * Real 802.2 LLC
>>> +		 */
>>> +		skb->protocol = htons(ETH_P_802_2);
>>> +}
>>
>> What about doublely tagged packets?
>
> No problem. Once they are untagged and reinjected they are untagged
> again and reinjected again:
>
> ->  __netif_reveive_skb
> vlan_untag
> vlan_do_receive
> ->  __netif_receive_skb
> vlan_untag
> vlan_do_receive

Hi Jiri,

Instead of untagging and reinjecting, wouldn't it be possible to remove all 802.1Q headers in a loop 
and directly deliver the untagged skb? Are there any hw-accel implementations that remove several 
level of tagging?

	Nicolas.