From patchwork Fri Oct 22 14:38:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 68865 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 A5C50B70AA for ; Sat, 23 Oct 2010 01:38:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757359Ab0JVOia (ORCPT ); Fri, 22 Oct 2010 10:38:30 -0400 Received: from exchange.solarflare.com ([216.237.3.220]:53423 "EHLO exchange.solarflare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757348Ab0JVOi3 (ORCPT ); Fri, 22 Oct 2010 10:38:29 -0400 Received: from [10.17.20.50] ([10.17.20.50]) by exchange.solarflare.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Oct 2010 07:38:28 -0700 Subject: [PATCH net-next-2.6] net: NETIF_F_HW_CSUM does not imply FCoE CRC offload From: Ben Hutchings To: David Miller Cc: netdev@vger.kernel.org, Yi Zou Organization: Solarflare Communications Date: Fri, 22 Oct 2010 15:38:26 +0100 Message-ID: <1287758306.2316.35.camel@achroite.uk.solarflarecom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 (2.30.2-4.fc13) X-OriginalArrivalTime: 22 Oct 2010 14:38:29.0179 (UTC) FILETIME=[CAFEF0B0:01CB71F6] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.500.1024-17718.005 X-TM-AS-Result: No--5.684100-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org NETIF_F_HW_CSUM indicates the ability to update an TCP/IP-style 16-bit checksum with the checksum of an arbitrary part of the packet data, whereas the FCoE CRC is something entirely different. Signed-off-by: Ben Hutchings Cc: stable@kernel.org [2.6.32+] --- net/core/dev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index a698252..8ab61de 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1683,10 +1683,10 @@ EXPORT_SYMBOL(netif_device_attach); static bool can_checksum_protocol(unsigned long features, __be16 protocol) { - return ((features & NETIF_F_GEN_CSUM) || - ((features & NETIF_F_IP_CSUM) && + return ((features & NETIF_F_NO_CSUM) || + ((features & NETIF_F_V4_CSUM) && protocol == htons(ETH_P_IP)) || - ((features & NETIF_F_IPV6_CSUM) && + ((features & NETIF_F_V6_CSUM) && protocol == htons(ETH_P_IPV6)) || ((features & NETIF_F_FCOE_CRC) && protocol == htons(ETH_P_FCOE)));