lkml.org 
[lkml]   [2018]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH net-next 1/2] ipv4: replace ip_hdr() with skb->data for optimization
On Tue, Jun 5, 2018 at 8:20 PM, Paolo Abeni <pabeni@redhat.com> wrote:
> On Tue, 2018-06-05 at 08:04 -0400, Yafang Shao wrote:
>> In ip receive path, when ip header hasn't been pulled yet, ip_hdr() and
>> skb->data are pointing to the same byte.
>>
>> In ip output path, when ip header is just pushed, ip_hdr() and skb->data
>> are pointing to the same byte.
>>
>> As ip_hdr() is more expensive than using skb->data, so replace ip_hdr()
>> with skb->data in these situations for optimization.
>
> IMHO this makes the code less readable and more error prone. Which kind
> of performance improvement do you measure here?
>

Correct the cc list.

Hi Paolo,

There's a "+" opertaion in ip_hdr(), using skb->data and avoid this operation.

Thanks
Yafang

\
 
 \ /
  Last update: 2018-06-05 14:30    [W:0.021 / U:41.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site