[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140321.140730.1007660405690890605.davem@davemloft.net>
Date: Fri, 21 Mar 2014 14:07:30 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: kaber@...sh.net, herbert@...dor.apana.org.au, hkchu@...gle.com,
mwdalton@...gle.com, netdev@...r.kernel.org
Subject: Re: [RFC] csum experts, csum_replace2() is too expensive
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Thu, 20 Mar 2014 11:49:01 -0700
> csum_replace2() uses about 29 cycles, while a plain ip_send_check() is
> way faster (16 cycles)
>
> csum_partial() is not really meant for doing checksums over 8 bytes !
>
> Any idea how to make the thing really fast as intended ?
>
> I saw csum_partial() consuming 1% of cpu cycles in a GRO workload, that
> is insane...
>
> Following patch might be the fastest thing ?
>
> (At this point we already have validated IP checksum)
...
> @@ -1434,8 +1434,8 @@ static int inet_gro_complete(struct sk_buff *skb, int nhoff)
> int proto = iph->protocol;
> int err = -ENOSYS;
>
> - csum_replace2(&iph->check, iph->tot_len, newlen);
> iph->tot_len = newlen;
> + ip_send_check(&iph);
Yeah the csum_replace*() are extremely suboptimal.
We should be able to cons up something cheap like the trick that
ip_decrease_ttl() uses.
https://tools.ietf.org/html/rfc1624
https://tools.ietf.org/html/rfc1141
--
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