diff options
author | Alexander Duyck <aduyck@mirantis.com> | 2016-04-02 03:05:14 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-04-26 06:21:50 -0400 |
commit | b0fe3306432796c8f7adbede8ccd479bb7b53d0a (patch) | |
tree | 05cd499f2b7f606c86af6fa75424c02a69e06d6e /drivers/net/ethernet/intel/i40evf/i40evf_main.c | |
parent | 6a025a50b523478b7c8112643cc94f5fd3d312ce (diff) |
i40e/i40evf: Clean up feature flags
The feature flags list for i40e and i40evf is beginning to become pretty
massive. I plan to add another 4 or so features to these drivers and
duplicating the flags for each and every flags list is becoming a bit
repetitive.
The primary change here is that we now build our features list around
hw_encap_features. After that we assign that to vlan_features,
hw_features, and finally map that onto features. In addition we end up
throwing features onto hw_encap_features that end up having no effect such
as the Rx offloads and SCTP_CRC. However that should have no impact and
makes things a bit easier for us as hw_encap_features is one of the less
updated features maps available.
For i40evf I went through and sanity checked a few features as well.
Specifically RXCSUM was being set as a read-only feature which didn't make
much sense. I have updated things so we can clear the NETIF_F_RXCSUM flag
since that is really a software feature and not a hardware one anyway so
disabling it is just a matter of ignoring the result from the hardware.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40evf_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_main.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index 9110319a8f00..e3857d890cfb 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
@@ -2337,40 +2337,38 @@ int i40evf_process_config(struct i40evf_adapter *adapter) | |||
2337 | return -ENODEV; | 2337 | return -ENODEV; |
2338 | } | 2338 | } |
2339 | 2339 | ||
2340 | netdev->features |= NETIF_F_HIGHDMA | | 2340 | netdev->hw_enc_features |= NETIF_F_SG | |
2341 | NETIF_F_SG | | 2341 | NETIF_F_IP_CSUM | |
2342 | NETIF_F_IP_CSUM | | 2342 | NETIF_F_IPV6_CSUM | |
2343 | NETIF_F_SCTP_CRC | | 2343 | NETIF_F_HIGHDMA | |
2344 | NETIF_F_IPV6_CSUM | | 2344 | NETIF_F_SOFT_FEATURES | |
2345 | NETIF_F_TSO | | 2345 | NETIF_F_TSO | |
2346 | NETIF_F_TSO6 | | 2346 | NETIF_F_TSO_ECN | |
2347 | NETIF_F_TSO_ECN | | 2347 | NETIF_F_TSO6 | |
2348 | NETIF_F_GSO_GRE | | 2348 | NETIF_F_GSO_GRE | |
2349 | NETIF_F_GSO_UDP_TUNNEL | | 2349 | NETIF_F_GSO_UDP_TUNNEL | |
2350 | NETIF_F_RXCSUM | | 2350 | NETIF_F_GSO_UDP_TUNNEL_CSUM | |
2351 | NETIF_F_GRO; | 2351 | NETIF_F_SCTP_CRC | |
2352 | 2352 | NETIF_F_RXHASH | | |
2353 | netdev->hw_enc_features |= NETIF_F_IP_CSUM | | 2353 | NETIF_F_RXCSUM | |
2354 | NETIF_F_IPV6_CSUM | | 2354 | 0; |
2355 | NETIF_F_TSO | | 2355 | |
2356 | NETIF_F_TSO6 | | 2356 | if (!(adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE)) |
2357 | NETIF_F_TSO_ECN | | 2357 | netdev->hw_enc_features ^= NETIF_F_GSO_UDP_TUNNEL_CSUM; |
2358 | NETIF_F_GSO_GRE | | 2358 | |
2359 | NETIF_F_GSO_UDP_TUNNEL | | 2359 | /* record features VLANs can make use of */ |
2360 | NETIF_F_GSO_UDP_TUNNEL_CSUM; | 2360 | netdev->vlan_features |= netdev->hw_enc_features; |
2361 | 2361 | ||
2362 | if (adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE) | 2362 | /* Write features and hw_features separately to avoid polluting |
2363 | netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM; | 2363 | * with, or dropping, features that are set when we registgered. |
2364 | 2364 | */ | |
2365 | /* always clear VLAN features because they can change at every reset */ | 2365 | netdev->hw_features |= netdev->hw_enc_features; |
2366 | netdev->features &= ~(I40EVF_VLAN_FEATURES); | 2366 | |
2367 | /* copy netdev features into list of user selectable features */ | 2367 | netdev->features |= netdev->hw_enc_features | I40EVF_VLAN_FEATURES; |
2368 | netdev->hw_features |= netdev->features; | 2368 | |
2369 | 2369 | /* disable VLAN features if not supported */ | |
2370 | if (vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) { | 2370 | if (!(vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN)) |
2371 | netdev->vlan_features = netdev->features; | 2371 | netdev->features ^= I40EVF_VLAN_FEATURES; |
2372 | netdev->features |= I40EVF_VLAN_FEATURES; | ||
2373 | } | ||
2374 | 2372 | ||
2375 | adapter->vsi.id = adapter->vsi_res->vsi_id; | 2373 | adapter->vsi.id = adapter->vsi_res->vsi_id; |
2376 | 2374 | ||