From patchwork Wed Nov 10 01:09:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gross X-Patchwork-Id: 70604 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 D0567B713B for ; Wed, 10 Nov 2010 12:09:18 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849Ab0KJBJO (ORCPT ); Tue, 9 Nov 2010 20:09:14 -0500 Received: from mail-qw0-f46.google.com ([209.85.216.46]:61552 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275Ab0KJBJM (ORCPT ); Tue, 9 Nov 2010 20:09:12 -0500 Received: by qwc9 with SMTP id 9so1204qwc.19 for ; Tue, 09 Nov 2010 17:09:11 -0800 (PST) Received: by 10.224.46.5 with SMTP id h5mr5897904qaf.27.1289351351534; Tue, 09 Nov 2010 17:09:11 -0800 (PST) Received: from umstead.nicira.com (173-164-247-25-SFBA.hfc.comcastbusiness.net [173.164.247.25]) by mx.google.com with ESMTPS id nb14sm61043qcb.12.2010.11.09.17.09.10 (version=SSLv3 cipher=RC4-MD5); Tue, 09 Nov 2010 17:09:11 -0800 (PST) From: Jesse Gross To: David Miller Cc: netdev@vger.kernel.org, Hao Zheng , Eilon Greenstein Subject: [PATCH net-2.6 2/3] bnx2x: Look inside vlan when determining checksum proto. Date: Tue, 9 Nov 2010 17:09:03 -0800 Message-Id: <1289351344-14340-2-git-send-email-jesse@nicira.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1289351344-14340-1-git-send-email-jesse@nicira.com> References: <1289351344-14340-1-git-send-email-jesse@nicira.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Hao Zheng Currently the skb->protocol field is used to setup checksum offloading on transmit for the correct protocol. However, if vlan offloading is disabled or otherwise not used, the protocol field will be ETH_P_8021Q, not the actual protocol. This will cause the checksum to be not computed correctly, even though the hardware is capable of looking inside vlan tags. Instead, look inside the header if necessary to determine the correct protocol type. To some extent this fixes a regression from 2.6.36 because it was previously not possible to disable vlan offloading and this error case was not exposed. Signed-off-by: Hao Zheng CC: Eilon Greenstein Signed-off-by: Jesse Gross --- drivers/net/bnx2x/bnx2x_cmn.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 459614d..94d5f59 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -1680,7 +1680,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) rc = XMIT_PLAIN; else { - if (skb->protocol == htons(ETH_P_IPV6)) { + if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) { rc = XMIT_CSUM_V6; if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) rc |= XMIT_CSUM_TCP;