Subject: Re: [PATCH v2 net] net: Account for all vlan headers in skb_mac_gso_segment

From: Vlad Yasevich <[email-masked]>
Date: Thu, 27 Mar 2014 21:05:41 -0400

On 03/27/2014 06:21 PM, Eric Dumazet wrote:
> On Thu, 2014-03-27 at 17:26 -0400, Vlad Yasevich wrote:
> 
>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> index 869c7af..cac38ba 100644
>> --- a/net/core/skbuff.c
>> +++ b/net/core/skbuff.c
>> @@ -2866,8 +2866,9 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
>>  	int err = -ENOMEM;
>>  	int i = 0;
>>  	int pos;
>> +	int dummy;
>>  
>> -	proto = skb_network_protocol(head_skb);
>> +	proto = skb_network_protocol(head_skb, &dummy);
>>  	if (unlikely(!proto))
>>  		return ERR_PTR(-EINVAL);
>>  
> 
> I am wondering if '&dummy' could be replaced by &doffset.
> 
> We have :
> 
> unsigned int doffset = head_skb->data - skb_mac_header(head_skb);
> 
> It looks like this is the same content than 'dummy', right ?
> 

No, that shouldn't be.  doffset is the offset of data past the
ip and tcp headers.  Dummy above will usually be the size of mac header
which at this point is useless to us.   The only time it might
be useful is if we have more encapsulations inside the tcp/udp
headers that skb_network_protocol would actually parse
(may be vlan on top of vxlan, so that vlan tagged frame is put
inside the UDP payload.  not sure if its possible).  But I think
this is already handled.

-vlad