From patchwork Mon Jan 14 12:15:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,3/3] Use hardware checksum for UDPv6 and ICMPv6 Date: Mon, 14 Jan 2013 02:15:07 -0000 From: David Woodhouse X-Patchwork-Id: 211780 Message-Id: <1358165707.27054.67.camel@shinybook.infradead.org> To: netdev@vger.kernel.org This actually enables the use of CHECKSUM_PARTIAL for outbound ICMPv6 frames. My check in the driver for non-hw-csum frames was *also* triggering when I was running 'nc -u' over IPv6, and this appears to fix that too. Is there a reason it wasn't happening already? I only see the driver check trigger for ndisc and igmp frames now, and I don't think we care very much about those? Signed-off-by: David Woodhouse diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 5552d13..8a27090 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -1370,7 +1370,12 @@ alloc_new_skb: /* * Fill in the control structures */ - skb->ip_summed = CHECKSUM_NONE; + if ((sk->sk_protocol == IPPROTO_ICMPV6 || + sk->sk_protocol == IPPROTO_UDP) && + rt->dst.dev->features & NETIF_F_HW_CSUM) + skb->ip_summed = CHECKSUM_PARTIAL; + else + skb->ip_summed = CHECKSUM_NONE; skb->csum = 0; /* reserve for fragmentation and ipsec header */ skb_reserve(skb, hh_len + sizeof(struct frag_hdr) +