Commit ba6cc7f6 authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher

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: default avatarMitch Williams <mitch.a.williams@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 47c46778
...@@ -2323,29 +2323,20 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw) ...@@ -2323,29 +2323,20 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw)
**/ **/
int i40evf_process_config(struct i40evf_adapter *adapter) int i40evf_process_config(struct i40evf_adapter *adapter)
{ {
struct i40e_virtchnl_vf_resource *vfres = adapter->vf_res;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
int i; int i;
/* got VF config message back from PF, now we can parse it */ /* got VF config message back from PF, now we can parse it */
for (i = 0; i < adapter->vf_res->num_vsis; i++) { for (i = 0; i < vfres->num_vsis; i++) {
if (adapter->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV) if (vfres->vsi_res[i].vsi_type == I40E_VSI_SRIOV)
adapter->vsi_res = &adapter->vf_res->vsi_res[i]; adapter->vsi_res = &vfres->vsi_res[i];
} }
if (!adapter->vsi_res) { if (!adapter->vsi_res) {
dev_err(&adapter->pdev->dev, "No LAN VSI found\n"); dev_err(&adapter->pdev->dev, "No LAN VSI found\n");
return -ENODEV; return -ENODEV;
} }
if (adapter->vf_res->vf_offload_flags
& I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {
netdev->vlan_features = netdev->features &
~(NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER);
netdev->features |= NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER;
}
netdev->features |= NETIF_F_HIGHDMA | netdev->features |= NETIF_F_HIGHDMA |
NETIF_F_SG | NETIF_F_SG |
NETIF_F_IP_CSUM | NETIF_F_IP_CSUM |
...@@ -2354,7 +2345,7 @@ int i40evf_process_config(struct i40evf_adapter *adapter) ...@@ -2354,7 +2345,7 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
NETIF_F_TSO | NETIF_F_TSO |
NETIF_F_TSO6 | NETIF_F_TSO6 |
NETIF_F_TSO_ECN | NETIF_F_TSO_ECN |
NETIF_F_GSO_GRE | NETIF_F_GSO_GRE |
NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_RXCSUM | NETIF_F_RXCSUM |
NETIF_F_GRO; NETIF_F_GRO;
...@@ -2371,9 +2362,15 @@ int i40evf_process_config(struct i40evf_adapter *adapter) ...@@ -2371,9 +2362,15 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE) if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE)
netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM; netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
/* always clear VLAN features because they can change at every reset */
netdev->features &= ~(I40EVF_VLAN_FEATURES);
/* copy netdev features into list of user selectable features */ /* copy netdev features into list of user selectable features */
netdev->hw_features |= netdev->features; netdev->hw_features |= netdev->features;
netdev->hw_features &= ~NETIF_F_RXCSUM;
if (vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {
netdev->vlan_features = netdev->features;
netdev->features |= I40EVF_VLAN_FEATURES;
}
adapter->vsi.id = adapter->vsi_res->vsi_id; adapter->vsi.id = adapter->vsi_res->vsi_id;
......
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