diff options
author | Edward Cree <ecree@solarflare.com> | 2016-02-11 21:49:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-12 11:52:15 +0100 |
commit | d75f1306d9464d535007f05e5da0afcf9e3916d9 (patch) | |
tree | 6ea2ba7510796abb2605aef6bdbd7f25dfc3d6a1 /net/ipv6/ip6_checksum.c | |
parent | net: local checksum offload for encapsulation (diff) | |
download | linux-d75f1306d9464d535007f05e5da0afcf9e3916d9.tar.xz linux-d75f1306d9464d535007f05e5da0afcf9e3916d9.zip |
net: udp: always set up for CHECKSUM_PARTIAL offload
If the dst device doesn't support it, it'll get fixed up later anyway
by validate_xmit_skb(). Also, this allows us to take advantage of LCO
to avoid summing the payload multiple times.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_checksum.c')
-rw-r--r-- | net/ipv6/ip6_checksum.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c index 4924bd704e89..8f920580976f 100644 --- a/net/ipv6/ip6_checksum.c +++ b/net/ipv6/ip6_checksum.c @@ -103,22 +103,11 @@ void udp6_set_csum(bool nocheck, struct sk_buff *skb, uh->check = udp_v6_check(len, saddr, daddr, lco_csum(skb)); if (uh->check == 0) uh->check = CSUM_MANGLED_0; - } else if (skb_dst(skb) && skb_dst(skb)->dev && - (skb_dst(skb)->dev->features & NETIF_F_IPV6_CSUM)) { + } else { skb->ip_summed = CHECKSUM_PARTIAL; skb->csum_start = skb_transport_header(skb) - skb->head; skb->csum_offset = offsetof(struct udphdr, check); uh->check = ~udp_v6_check(len, saddr, daddr, 0); - } else { - __wsum csum; - - uh->check = 0; - csum = skb_checksum(skb, 0, len, 0); - uh->check = udp_v6_check(len, saddr, daddr, csum); - if (uh->check == 0) - uh->check = CSUM_MANGLED_0; - - skb->ip_summed = CHECKSUM_UNNECESSARY; } } EXPORT_SYMBOL(udp6_set_csum); |