lkml.org 
[lkml]   [2014]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] csum experts, csum_replace2() is too expensive
From
Date
On Fri, 2014-03-21 at 05:50 -0700, Eric Dumazet wrote:

> Or the fact that we mix 16 bit stores and 32bit loads ?
>
> iph->tot_len = newlen;
> iph->check = 0;
> iph->check = ip_fast_csum(iph, 5);

Yep definitely. Using 16 bit loads in ip_fast_csum() totally removes the
stall. I no longer see inet_gro_complete() in perf top...

+ if (__builtin_constant_p(ihl) && ihl == 5) {
+ asm(" movw (%[iph]), %w[sum]\n" /* ihl/version/tos */
+ " addw 2(%[iph]), %w[sum]\n" /* tot_len */
+ " adcw 8(%[iph]), %w[sum]\n" /* ttl/protocol */
+ " adcw 10(%[iph]), %w[sum]\n" /* check */
+ " adcl 4(%[iph]), %[sum]\n" /* id/frag_off */
+ " adcl 12(%[iph]), %[sum]\n" /* saddr */
+ " adcl 16(%[iph]), %[sum]\n" /* daddr */
+ " adcl $0, %[sum]\n"
+ : [sum] "=r" (sum)
+ : [iph] "r" (iph)
+ );
+ return csum_fold(sum);




\
 
 \ /
  Last update: 2014-03-21 14:41    [W:0.081 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site