]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: Only offload VLAN tag if enabled
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Tue, 12 Apr 2016 15:30:49 +0000 (08:30 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 17:41:10 +0000 (10:41 -0700)
Orabug: 23176970

The driver was offloading the VLAN tag into the skb
any time there was a VLAN tag and the hardware stripping was
enabled.  Just check to make sure it's enabled before put_tag.

Change-Id: Ife95290c06edd9a616393b38679923938b382241
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a149f2c323b62bc6cff91d874d853250250e8497)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index 86378eb4ee11d79650b42d153a54e47314974685..cdd452ac6f727e0800182501fb8de34be08c8bb5 100644 (file)
@@ -1369,7 +1369,8 @@ static void i40e_receive_skb(struct i40e_ring *rx_ring,
 {
        struct i40e_q_vector *q_vector = rx_ring->q_vector;
 
-       if (vlan_tag & VLAN_VID_MASK)
+       if ((rx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
+           (vlan_tag & VLAN_VID_MASK))
                __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
 
        napi_gro_receive(&q_vector->napi, skb);
index 9a934aacf5b64cc0a12d5f64c6c41d0a60e6e7cd..ed7e92cf34c8fd49bc1a55ddc2f53ef4a3e3a507 100644 (file)
@@ -841,7 +841,8 @@ static void i40e_receive_skb(struct i40e_ring *rx_ring,
 {
        struct i40e_q_vector *q_vector = rx_ring->q_vector;
 
-       if (vlan_tag & VLAN_VID_MASK)
+       if ((rx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
+           (vlan_tag & VLAN_VID_MASK))
                __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
 
        napi_gro_receive(&q_vector->napi, skb);