diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2018-05-07 20:08:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-09 04:30:06 +0200 |
commit | 9a0d41b3598ff62ecb26661bbfb1d523586cdea3 (patch) | |
tree | ee974ce5c61f56a2b9f64ed3b39fe2159308f049 /net/ipv6/udp_offload.c | |
parent | udp: Do not pass MSS as parameter to GSO segmentation (diff) | |
download | linux-9a0d41b3598ff62ecb26661bbfb1d523586cdea3.tar.xz linux-9a0d41b3598ff62ecb26661bbfb1d523586cdea3.zip |
udp: Do not pass checksum as a parameter to GSO segmentation
This patch is meant to allow us to avoid having to recompute the checksum
from scratch and have it passed as a parameter.
Instead of taking that approach we can take advantage of the fact that the
length that was used to compute the existing checksum is included in the
UDP header.
Finally to avoid the need to invert the result we can just call csum16_add
and csum16_sub directly. By doing this we can avoid a number of
instructions in the loop that is handling segmentation.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/ipv6/udp_offload.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index dea03ec09715..61e34f1d2fa2 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c @@ -20,15 +20,10 @@ static struct sk_buff *__udp6_gso_segment(struct sk_buff *gso_skb, netdev_features_t features) { - const struct ipv6hdr *ip6h = ipv6_hdr(gso_skb); - unsigned int mss = skb_shinfo(gso_skb)->gso_size; - if (!can_checksum_protocol(features, htons(ETH_P_IPV6))) return ERR_PTR(-EIO); - return __udp_gso_segment(gso_skb, features, - udp_v6_check(sizeof(struct udphdr) + mss, - &ip6h->saddr, &ip6h->daddr, 0)); + return __udp_gso_segment(gso_skb, features); } static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, |