aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e
diff options
context:
space:
mode:
authorGreg Rose <gregory.v.rose@intel.com>2015-03-31 03:45:03 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-03 06:54:30 -0400
commit31eaaccff0fedb7cf6b6716efa3a2b8b8315ec68 (patch)
tree4cb3f7fe4602ed5499ebd69d7661f49518509573 /drivers/net/ethernet/intel/i40e
parent6d7b967db3b1607c789f62936d68ced6321482ed (diff)
i40e/i40evf: Set Ethernet protocol correctly when Tx VLAN offloads are disabled
If transmit VLAN HW offloads are disabled then the network stack sends up an skb with the protocol set to 8021q. In that case to get the correct checksum offloads we have to reset the skb protocol to the encapsulated ethertype. Change-ID: I903d78533de09b1c5d3ec695ee1990dd0fa5dd0d Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 5a1a67733b88..d8989f9d1798 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2057,6 +2057,19 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
2057 __be16 protocol = skb->protocol; 2057 __be16 protocol = skb->protocol;
2058 u32 tx_flags = 0; 2058 u32 tx_flags = 0;
2059 2059
2060 if (protocol == htons(ETH_P_8021Q) &&
2061 !(tx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) {
2062 /* When HW VLAN acceleration is turned off by the user the
2063 * stack sets the protocol to 8021q so that the driver
2064 * can take any steps required to support the SW only
2065 * VLAN handling. In our case the driver doesn't need
2066 * to take any further steps so just set the protocol
2067 * to the encapsulated ethertype.
2068 */
2069 skb->protocol = vlan_get_protocol(skb);
2070 goto out;
2071 }
2072
2060 /* if we have a HW VLAN tag being added, default to the HW one */ 2073 /* if we have a HW VLAN tag being added, default to the HW one */
2061 if (skb_vlan_tag_present(skb)) { 2074 if (skb_vlan_tag_present(skb)) {
2062 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT; 2075 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT;