• Edward Cree's avatar
    net: local checksum offload for encapsulation · 179bc67f
    Edward Cree authored
    The arithmetic properties of the ones-complement checksum mean that a
     correctly checksummed inner packet, including its checksum, has a ones
     complement sum depending only on whatever value was used to initialise
     the checksum field before checksumming (in the case of TCP and UDP,
     this is the ones complement sum of the pseudo header, complemented).
    Consequently, if we are going to offload the inner checksum with
     CHECKSUM_PARTIAL, we can compute the outer checksum based only on the
     packed data not covered by the inner checksum, and the initial value of
     the inner checksum field.
    Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    179bc67f
ip6_checksum.c 3.21 KB