Skip to content

Commit bfb0ebe

Browse files
ndnunleyJeff Kirsher
authored andcommitted
i40e: don't allow changes to HW VLAN stripping on active port VLANs
Modifying the VLAN stripping options when a port VLAN is configured will break traffic for the VSI, and conceptually doesn't make sense, so don't allow this. Signed-off-by: Nicholas Nunley <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent cdc594e commit bfb0ebe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,6 +2654,10 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
26542654
struct i40e_vsi_context ctxt;
26552655
i40e_status ret;
26562656

2657+
/* Don't modify stripping options if a port VLAN is active */
2658+
if (vsi->info.pvid)
2659+
return;
2660+
26572661
if ((vsi->info.valid_sections &
26582662
cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID)) &&
26592663
((vsi->info.port_vlan_flags & I40E_AQ_VSI_PVLAN_MODE_MASK) == 0))
@@ -2684,6 +2688,10 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
26842688
struct i40e_vsi_context ctxt;
26852689
i40e_status ret;
26862690

2691+
/* Don't modify stripping options if a port VLAN is active */
2692+
if (vsi->info.pvid)
2693+
return;
2694+
26872695
if ((vsi->info.valid_sections &
26882696
cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID)) &&
26892697
((vsi->info.port_vlan_flags & I40E_AQ_VSI_PVLAN_EMOD_MASK) ==

0 commit comments

Comments
 (0)