Commit e0f60a81 authored by Paweł Jabłoński's avatar Paweł Jabłoński Committed by Jeff Kirsher

i40evf: Allow turning off offloads when the VF has VLAN set

This patch adds back the capability to turn off offloads when VF has
VLAN set. The commit 0a3b4f70 ("i40evf: enable support for VF VLAN
tag stripping control") adds the i40evf_set_features function and
changes the 'turn off' flow for offloads. This patch adds that
capability back by moving checking the VLAN option for VF to the
next statement.
Signed-off-by: default avatarPaweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent ca6e1d0a
......@@ -2344,13 +2344,19 @@ static int i40evf_set_features(struct net_device *netdev,
{
struct i40evf_adapter *adapter = netdev_priv(netdev);
if (!VLAN_ALLOWED(adapter))
return -EINVAL;
/* Don't allow changing VLAN_RX flag when VLAN is set for VF
* and return an error in this case
*/
if (VLAN_ALLOWED(adapter)) {
if (features & NETIF_F_HW_VLAN_CTAG_RX)
adapter->aq_required |= I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;
adapter->aq_required |=
I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;
else
adapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;
adapter->aq_required |=
I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;
} else if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX) {
return -EINVAL;
}
return 0;
}
......
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