]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends
authorEric Dumazet <edumazet@google.com>
Thu, 13 Sep 2018 14:58:56 +0000 (07:58 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:48:07 +0000 (19:48 -0600)
commit119e56abf323af69ef1b4ede76b7a11d3228daa4
treebf34cd2a47f676dbd19146cad1e4fae26b829824
parent91723eff1f20ab3368ef3537fa14ccedb6e7e0a9
net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends

BugLink: https://bugs.launchpad.net/bugs/1836117
After working on IP defragmentation lately, I found that some large
packets defeat CHECKSUM_COMPLETE optimization because of NIC adding
zero paddings on the last (small) fragment.

While removing the padding with pskb_trim_rcsum(), we set skb->ip_summed
to CHECKSUM_NONE, forcing a full csum validation, even if all prior
fragments had CHECKSUM_COMPLETE set.

We can instead compute the checksum of the part we are trimming,
usually smaller than the part we keep.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 88078d98d1bb085d72af8437707279e203524fa5)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/linux/skbuff.h
net/core/skbuff.c