[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <527929EA.5070600@6wind.com>
Date: Tue, 05 Nov 2013 18:24:58 +0100
From: Christophe Gouault <christophe.gouault@...nd.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: Steffen Klassert <steffen.klassert@...unet.com>,
"David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
netdev@...r.kernel.org, Saurabh Mohan <saurabh.mohan@...tta.com>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Subject: Re: [PATCH net v2] vti: fix spd lookup: match plaintext pkt, not
ipsec pkt
Hello Eric,
On 11/05/2013 06:01 PM, Eric Dumazet wrote:
> On Tue, 2013-11-05 at 16:58 +0100, Christophe Gouault wrote:
>
>> diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
>> index 6e87f85..bcd85be 100644
>> --- a/net/ipv4/ip_vti.c
>> +++ b/net/ipv4/ip_vti.c
>> @@ -126,6 +126,7 @@ static int vti_rcv(struct sk_buff *skb)
>> if (tunnel != NULL) {
>> struct pcpu_tstats *tstats;
>> u32 oldmark = skb->mark;
>> + u16 netoff = skb_network_header(skb) - skb->data;
> unsigned int nhoff = skb_network_offset(skb);
>
> There is no need to assume u16 here, even if the implementation
> currently has this assumption.
>
> You also could just use faster operation (no need to access
> skb->data/head)
>
> unsigned int old_nh = skb->network_header;
>
> ...
> at restore, use :
> skb->network_header = old_nh;
>
> instead of the more expensive skb_set_network_header()
OK, I was not sure if it was generally agreed to directly manipulate the
skb->network_header. I will send a v3 tomorrow with your suggested
optimization.
Best Regards,
Christophe
--
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