From patchwork Mon Jan 14 12:15:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 211780 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DE8ED2C0091 for ; Mon, 14 Jan 2013 23:15:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756226Ab3ANMPK (ORCPT ); Mon, 14 Jan 2013 07:15:10 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36481 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755388Ab3ANMPJ (ORCPT ); Mon, 14 Jan 2013 07:15:09 -0500 Received: from shinybook.infradead.org ([2001:8b0:10b:1:e6ce:8fff:fe1f:f2c0]) by merlin.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux)) id 1TuiwW-0002Db-C9 for netdev@vger.kernel.org; Mon, 14 Jan 2013 12:15:08 +0000 Message-ID: <1358165707.27054.67.camel@shinybook.infradead.org> Subject: [RFC PATCH 3/3] Use hardware checksum for UDPv6 and ICMPv6 From: David Woodhouse To: netdev@vger.kernel.org Date: Mon, 14 Jan 2013 12:15:07 +0000 In-Reply-To: <1358165431.27054.62.camel@shinybook.infradead.org> References: <1358165431.27054.62.camel@shinybook.infradead.org> X-Mailer: Evolution 3.6.2 (3.6.2-3.fc18) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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) +