From patchwork Thu Mar 19 11:13:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 24670 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 6E3E9DDE0F for ; Thu, 19 Mar 2009 22:13:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755511AbZCSLNd (ORCPT ); Thu, 19 Mar 2009 07:13:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755184AbZCSLNd (ORCPT ); Thu, 19 Mar 2009 07:13:33 -0400 Received: from qmta10.westchester.pa.mail.comcast.net ([76.96.62.17]:60497 "EHLO QMTA10.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755365AbZCSLNc (ORCPT ); Thu, 19 Mar 2009 07:13:32 -0400 Received: from OMTA10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA10.westchester.pa.mail.comcast.net with comcast id UxZz1b0040cZkys5AzDX82; Thu, 19 Mar 2009 11:13:31 +0000 Received: from lost.foo-projects.org ([63.64.152.142]) by OMTA10.westchester.pa.mail.comcast.net with comcast id UzD91b00Q34bfcX3WzDCpX; Thu, 19 Mar 2009 11:13:29 +0000 From: Jeff Kirsher Subject: [net-next PATCH 3/3] e1000e: allow tx of pre-formatted vlan tagged packets To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Arthur Jones , Jeff Kirsher , Stephen Hemminger , Alexander Duyck Date: Thu, 19 Mar 2009 04:13:08 -0700 Message-ID: <20090319111308.11601.93121.stgit@lost.foo-projects.org> In-Reply-To: <20090319111226.11601.40603.stgit@lost.foo-projects.org> References: <20090319111226.11601.40603.stgit@lost.foo-projects.org> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arthur Jones As with igb, when the e1000e driver is fed 802.1q packets with hardware checksum on, it chokes with an error of the form: checksum_partial proto=81! As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol. There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out wiht the correct hardware checksum. Thanks to Kand Ly for discovering the issue and the coming up with a solution. This patch is based upon his work. Fixups from Stephen Hemminger and Alexander Duyck Signed-off-by: Arthur Jones Signed-off-by: Jeff Kirsher CC: Stephen Hemminger CC: Alexander Duyck --- drivers/net/e1000e/netdev.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index da876d5..d092eaf 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -3764,10 +3764,16 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb) unsigned int i; u8 css; u32 cmd_len = E1000_TXD_CMD_DEXT; + __be16 protocol; if (skb->ip_summed != CHECKSUM_PARTIAL) return 0; + if (skb->protocol == cpu_to_be16(ETH_P_8021Q)) + protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto; + else + protocol = skb->protocol; + switch (skb->protocol) { case cpu_to_be16(ETH_P_IP): if (ip_hdr(skb)->protocol == IPPROTO_TCP) @@ -3780,7 +3786,8 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb) break; default: if (unlikely(net_ratelimit())) - e_warn("checksum_partial proto=%x!\n", skb->protocol); + e_warn("checksum_partial proto=%x!\n", + be16_to_cpu(protocol)); break; }