Skip to content

Commit 0a3b4f7

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
i40evf: enable support for VF VLAN tag stripping control
A recent commit 809481484e5d ("i40e/i40evf: support for VF VLAN tag stripping control") added support for VFs to negotiate the control of VLAN tag stripping. This should have allowed VFs to disable the feature. Unfortunately, the flag was set only in netdev->feature flags and not in netdev->hw_features. This ultimately causes the stack to assume that it cannot change the flag, so it was unchangeable and marked as [fixed] in the ethtool -k output. Fix this by setting the feature in hw_features first, just as we do for the PF code. This enables ethtool -K to disable the feature correctly, and fully enables user control of the VLAN tag stripping feature. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 052b93d commit 0a3b4f7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

drivers/net/ethernet/intel/i40evf/i40evf_main.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,10 +2423,6 @@ static netdev_features_t i40evf_features_check(struct sk_buff *skb,
24232423
return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
24242424
}
24252425

2426-
#define I40EVF_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_TX |\
2427-
NETIF_F_HW_VLAN_CTAG_RX |\
2428-
NETIF_F_HW_VLAN_CTAG_FILTER)
2429-
24302426
/**
24312427
* i40evf_fix_features - fix up the netdev feature bits
24322428
* @netdev: our net device
@@ -2439,9 +2435,11 @@ static netdev_features_t i40evf_fix_features(struct net_device *netdev,
24392435
{
24402436
struct i40evf_adapter *adapter = netdev_priv(netdev);
24412437

2442-
features &= ~I40EVF_VLAN_FEATURES;
2443-
if (adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
2444-
features |= I40EVF_VLAN_FEATURES;
2438+
if (!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
2439+
features &= ~(NETIF_F_HW_VLAN_CTAG_TX |
2440+
NETIF_F_HW_VLAN_CTAG_RX |
2441+
NETIF_F_HW_VLAN_CTAG_FILTER);
2442+
24452443
return features;
24462444
}
24472445

@@ -2572,9 +2570,17 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
25722570
*/
25732571
hw_features = hw_enc_features;
25742572

2573+
/* Enable VLAN features if supported */
2574+
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
2575+
hw_features |= (NETIF_F_HW_VLAN_CTAG_TX |
2576+
NETIF_F_HW_VLAN_CTAG_RX);
2577+
25752578
netdev->hw_features |= hw_features;
25762579

2577-
netdev->features |= hw_features | I40EVF_VLAN_FEATURES;
2580+
netdev->features |= hw_features;
2581+
2582+
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
2583+
netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
25782584

25792585
adapter->vsi.id = adapter->vsi_res->vsi_id;
25802586

0 commit comments

Comments
 (0)