aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArthur Jones <ajones@riverbed.com>2009-03-18 21:13:08 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-20 04:17:22 -0400
commit5f66f208064f083aab5e55935d0575892e033b59 (patch)
tree456dc327e6367be13fd04ec639c56f5f95e62d1f /drivers
parent1b7719c4559dc1522065d4cfd033f8bb8f969159 (diff)
e1000e: allow tx of pre-formatted vlan tagged packets
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 <kand@riverbed.com> for discovering the issue and the coming up with a solution. This patch is based upon his work. Fixups from Stephen Hemminger <shemminger@vyatta.com> and Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Arthur Jones <ajones@riverbed.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> CC: Stephen Hemminger <shemminger@vyatta.com> CC: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000e/netdev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index da876d59a9ca..d092eafde9bf 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)
3764 unsigned int i; 3764 unsigned int i;
3765 u8 css; 3765 u8 css;
3766 u32 cmd_len = E1000_TXD_CMD_DEXT; 3766 u32 cmd_len = E1000_TXD_CMD_DEXT;
3767 __be16 protocol;
3767 3768
3768 if (skb->ip_summed != CHECKSUM_PARTIAL) 3769 if (skb->ip_summed != CHECKSUM_PARTIAL)
3769 return 0; 3770 return 0;
3770 3771
3772 if (skb->protocol == cpu_to_be16(ETH_P_8021Q))
3773 protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
3774 else
3775 protocol = skb->protocol;
3776
3771 switch (skb->protocol) { 3777 switch (skb->protocol) {
3772 case cpu_to_be16(ETH_P_IP): 3778 case cpu_to_be16(ETH_P_IP):
3773 if (ip_hdr(skb)->protocol == IPPROTO_TCP) 3779 if (ip_hdr(skb)->protocol == IPPROTO_TCP)
@@ -3780,7 +3786,8 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
3780 break; 3786 break;
3781 default: 3787 default:
3782 if (unlikely(net_ratelimit())) 3788 if (unlikely(net_ratelimit()))
3783 e_warn("checksum_partial proto=%x!\n", skb->protocol); 3789 e_warn("checksum_partial proto=%x!\n",
3790 be16_to_cpu(protocol));
3784 break; 3791 break;
3785 } 3792 }
3786 3793