Commit 5f66f208 authored by Arthur Jones's avatar Arthur Jones Committed by David S. Miller

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: default avatarArthur Jones <ajones@riverbed.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b7719c4
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment