aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2016-04-01 16:34:31 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-06 23:27:26 -0400
commitba6cc7f6f194e3645368f87d951bedd7e3b75f39 (patch)
tree56cd02272f18f36d9e9c7fda6c2cfac96c1a52c6
parent47c46778e1905721433a413b2522a8e2b3d6c354 (diff)
i40evf: properly handle VLAN features
Correctly set the VLAN feature flags after setting the rest of the netdev flags. And don't set them in hw_features, because these can't be controlled by the VF driver. Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 4659ac2cf035..9110319a8f00 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2323,29 +2323,20 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw)
2323 **/ 2323 **/
2324int i40evf_process_config(struct i40evf_adapter *adapter) 2324int i40evf_process_config(struct i40evf_adapter *adapter)
2325{ 2325{
2326 struct i40e_virtchnl_vf_resource *vfres = adapter->vf_res;
2326 struct net_device *netdev = adapter->netdev; 2327 struct net_device *netdev = adapter->netdev;
2327 int i; 2328 int i;
2328 2329
2329 /* got VF config message back from PF, now we can parse it */ 2330 /* got VF config message back from PF, now we can parse it */
2330 for (i = 0; i < adapter->vf_res->num_vsis; i++) { 2331 for (i = 0; i < vfres->num_vsis; i++) {
2331 if (adapter->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV) 2332 if (vfres->vsi_res[i].vsi_type == I40E_VSI_SRIOV)
2332 adapter->vsi_res = &adapter->vf_res->vsi_res[i]; 2333 adapter->vsi_res = &vfres->vsi_res[i];
2333 } 2334 }
2334 if (!adapter->vsi_res) { 2335 if (!adapter->vsi_res) {
2335 dev_err(&adapter->pdev->dev, "No LAN VSI found\n"); 2336 dev_err(&adapter->pdev->dev, "No LAN VSI found\n");
2336 return -ENODEV; 2337 return -ENODEV;
2337 } 2338 }
2338 2339
2339 if (adapter->vf_res->vf_offload_flags
2340 & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {
2341 netdev->vlan_features = netdev->features &
2342 ~(NETIF_F_HW_VLAN_CTAG_TX |
2343 NETIF_F_HW_VLAN_CTAG_RX |
2344 NETIF_F_HW_VLAN_CTAG_FILTER);
2345 netdev->features |= NETIF_F_HW_VLAN_CTAG_TX |
2346 NETIF_F_HW_VLAN_CTAG_RX |
2347 NETIF_F_HW_VLAN_CTAG_FILTER;
2348 }
2349 netdev->features |= NETIF_F_HIGHDMA | 2340 netdev->features |= NETIF_F_HIGHDMA |
2350 NETIF_F_SG | 2341 NETIF_F_SG |
2351 NETIF_F_IP_CSUM | 2342 NETIF_F_IP_CSUM |
@@ -2354,7 +2345,7 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
2354 NETIF_F_TSO | 2345 NETIF_F_TSO |
2355 NETIF_F_TSO6 | 2346 NETIF_F_TSO6 |
2356 NETIF_F_TSO_ECN | 2347 NETIF_F_TSO_ECN |
2357 NETIF_F_GSO_GRE | 2348 NETIF_F_GSO_GRE |
2358 NETIF_F_GSO_UDP_TUNNEL | 2349 NETIF_F_GSO_UDP_TUNNEL |
2359 NETIF_F_RXCSUM | 2350 NETIF_F_RXCSUM |
2360 NETIF_F_GRO; 2351 NETIF_F_GRO;
@@ -2371,9 +2362,15 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
2371 if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE) 2362 if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE)
2372 netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM; 2363 netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
2373 2364
2365 /* always clear VLAN features because they can change at every reset */
2366 netdev->features &= ~(I40EVF_VLAN_FEATURES);
2374 /* copy netdev features into list of user selectable features */ 2367 /* copy netdev features into list of user selectable features */
2375 netdev->hw_features |= netdev->features; 2368 netdev->hw_features |= netdev->features;
2376 netdev->hw_features &= ~NETIF_F_RXCSUM; 2369
2370 if (vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {
2371 netdev->vlan_features = netdev->features;
2372 netdev->features |= I40EVF_VLAN_FEATURES;
2373 }
2377 2374
2378 adapter->vsi.id = adapter->vsi_res->vsi_id; 2375 adapter->vsi.id = adapter->vsi_res->vsi_id;
2379 2376