[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1395363257.9114.111.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 20 Mar 2014 17:54:17 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Patrick McHardy <kaber@...sh.net>,
"H.K. Jerry Chu" <hkchu@...gle.com>,
Michael Dalton <mwdalton@...gle.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [RFC] csum experts, csum_replace2() is too expensive
On Fri, 2014-03-21 at 08:13 +0800, Herbert Xu wrote:
> Your patch makes sense to me. However does it actually help
> your 1% in the GRO profile?
Well, I caught this strange csum_partial() presence in a profile,
but my question was more general than the GRO use case.
(BTW the patch didn't even compile ;) )
I guess that in GRO case, the following would be even faster...
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 8c54870db792..b8fe5e8a02dd 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1361,6 +1361,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
if (!ops || !ops->callbacks.gro_receive)
goto out_unlock;
+ /* GRO is limited to IPv4 with no options : ihl = 5 */
if (*(u8 *)iph != 0x45)
goto out_unlock;
@@ -1434,8 +1435,10 @@ 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);
+ /* GRO is limited to IPv4 with no options : ihl = 5 */
iph->tot_len = newlen;
+ iph->check = 0;
+ iph->check = ip_fast_csum((u8 *)iph, 5);
rcu_read_lock();
ops = rcu_dereference(inet_offloads[proto]);
--
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