From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jacob Wen <jian.w.wen@oracle.com>, netdev@vger.kernel.org
Cc: herbert@gondor.apana.org.au
Subject: Re: IP GRO verifies csum again?
Date: Thu, 18 Jul 2019 10:27:01 +0200 [thread overview]
Message-ID: <2154bca7-17d0-3ed3-ab58-55f33cd13ac5@gmail.com> (raw)
In-Reply-To: <6cc12686-a13d-81a8-ad3c-4601397c900e@oracle.com>
On 7/18/19 9:49 AM, Jacob Wen wrote:
> Hi,
>
> inet_gro_receive verifies IP csum but a NIC already did so and set CHECKSUM_UNNECESSARY.
>
>
> https://github.com/torvalds/linux/blob/v5.2/net/ipv4/af_inet.c#L1432-L1433
>
> if (unlikely(ip_fast_csum((u8 *)iph, 5)))
>
> goto out_unlock;
>
>
> Is this a bug?
>
This checksum validates the TCP one, which is the real cost, since we need to touch all
the packet.
We do not bother 'offloading' IPV4 checksum over 20 bytes or so, since in modern cpus,
having the cache line hot in cpu caches means the checksum is almost free.
Adding a test here would not always be a win, say for CHECKSUM_COMPLETE cases,
which we try to generalize in favor of old CHECKSUM_UNNECESSARY.
prev parent reply other threads:[~2019-07-18 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 7:49 IP GRO verifies csum again? Jacob Wen
2019-07-18 8:27 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2154bca7-17d0-3ed3-ab58-55f33cd13ac5@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=jian.w.wen@oracle.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox