Skip to content

Add GSO support for outer checksum w/ inner checksum offloads

Alexander Duyck netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 13 repliesIn review

Changes from v1 from the cover letter

* Dropped use of CHECKSUM_UNNECESSARY for remote checksum offload
* Left encap_hdr_csum as it will likely be needed in future for SCTP GSO
* Broke the changes out over many more patches
* Updated GRE segmentation to more closely match UDP tunnel segmentation

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10net: Drop unecessary enc_features variable from tunnel segmentation functionsnet/ipv4/gre_offload.c net/ipv4/udp_offload.c+6 -61 reply
2/10net: Move GSO csum into SKB_GSO_CBinclude/linux/skbuff.h net/core/skbuff.c+16 -141 reply
3/10net: Update remote checksum segmentation to support use of GSO checksumnet/core/skbuff.c net/ipv4/udp_offload.c+16 -162 replies
4/10net: Store checksum result for offloaded GSO checksumsinclude/linux/skbuff.h net/ipv4/tcp_offload.c+21 -20 replies
5/10net: Move skb_has_shared_frag check out of GRE code and into segmentationnet/core/skbuff.c net/ipv4/gre_offload.c+5 -111 reply
6/10gre: Use GSO flags to determine csum need instead of GRE flagsnet/ipv4/gre_offload.c+30 -342 replies
7/10gre: Use inner_proto to obtain inner header protocolnet/ipv4/gre_offload.c+2 -42 replies
8/10udp: Clean up the use of flags in UDP segmentation offloadnet/ipv4/udp_offload.c+18 -191 reply
9/10udp: Use uh->len instead of skb->len to compute checksum in segmentationnet/ipv4/udp_offload.c+13 -151 reply
10/10net: Allow tunnels to use inner checksum offloads with outer checksums needednet/core/skbuff.c+1 -21 reply

Reviews trailers per patch

6 of 10 patches have a Reviewed-by or Acked-by.

PatchTom Herbert
1/10A-b
2/10A-b
3/10
4/10
5/10A-b
6/10
7/10
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [net-next PATCH 00/10] Add GSO support for outer checksum w/ inner checksum offloads

This patch series updates the existing segmentation offload code for tunnels to make better use of existing and updated GSO checksum computation. This is done primarily through two mechanisms. First we maintain a separate checksum in the GSO context block of the sk_buff. This allows us to maintain two checksum values, one offloaded with values stored in csum_start and csum_offset, and one computed and tracked in SKB_GSO_CB(skb)->csum. By maintaining these two values we are able to take advantage of the same sort of math used in local checksum offload so that we can provide both inner and outer checksums with minimal overhead.

Below is the performance for a netperf session between an ixgbe PF and VF on the same host but in different namespaces. As can be seen a significant gain in performance can be had from allowing the use of Tx checksum offload on the inner headers while performing a software offload on the outer header computation:

 Recv   Send   Send                       Utilization  Service Demand
 Socket Socket Message Elapsed            Send  Recv   Send  Recv
 Size   Size   Size    Time    Throughput local remote local remote
 bytes  bytes  bytes   secs.   10^6bits/s % S   % U    us/KB us/KB

Before:
87380 16384 16384 10.00 12844.38 9.30 -1.00 0.712 -1.00
After:
87380 16384 16384 10.00 13216.63 6.78 -1.00 0.504 -1.000

Changes from v1:
* Dropped use of CHECKSUM_UNNECESSARY for remote checksum offload
* Left encap_hdr_csum as it will likely be needed in future for SCTP GSO
* Broke the changes out over many more patches
* Updated GRE segmentation to more closely match UDP tunnel segmentation

---

Alexander Duyck (10):
net: Drop unecessary enc_features variable from tunnel segmentation functions
net: Move GSO csum into SKB_GSO_CB
net: Update remote checksum segmentation to support use of GSO checksum
net: Store checksum result for offloaded GSO checksums
net: Move skb_has_shared_frag check out of GRE code and into segmentation
gre: Use GSO flags to determine csum need instead of GRE flags
gre: Use inner_proto to obtain inner header protocol
udp: Clean up the use of flags in UDP segmentation offload
udp: Use uh->len instead of skb->len to compute checksum in segmentation
net: Allow tunnels to use inner checksum offloads with outer checksums needed

 include/linux/skbuff.h |   29 +++++++++++----
 net/core/skbuff.c      |   34 +++++++++++-------
 net/ipv4/gre_offload.c |   85 ++++++++++++++++++--------------------------
 net/ipv4/tcp_offload.c |    8 +++-
 net/ipv4/udp_offload.c |   93 +++++++++++++++++++++++-------------------------
 5 files changed, 127 insertions(+), 122 deletions(-)