]>
Commit | Line | Data |
---|---|---|
1143c684 SL |
1 | From 9f6d2507384f998d0579495bdf59adecef23181a Mon Sep 17 00:00:00 2001 |
2 | From: Nicholas Nunley <nicholas.d.nunley@intel.com> | |
3 | Date: Wed, 6 Feb 2019 15:08:17 -0800 | |
4 | Subject: i40e: don't allow changes to HW VLAN stripping on active port VLANs | |
5 | ||
6 | [ Upstream commit bfb0ebed53857cfc57f11c63fa3689940d71c1c8 ] | |
7 | ||
8 | Modifying the VLAN stripping options when a port VLAN is configured | |
9 | will break traffic for the VSI, and conceptually doesn't make sense, | |
10 | so don't allow this. | |
11 | ||
12 | Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com> | |
13 | Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | |
14 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
15 | --- | |
16 | drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++ | |
17 | 1 file changed, 8 insertions(+) | |
18 | ||
19 | diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c | |
20 | index 06b38f50980c5..22c43a776c6cd 100644 | |
21 | --- a/drivers/net/ethernet/intel/i40e/i40e_main.c | |
22 | +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |
23 | @@ -2263,6 +2263,10 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi) | |
24 | struct i40e_vsi_context ctxt; | |
25 | i40e_status ret; | |
26 | ||
27 | + /* Don't modify stripping options if a port VLAN is active */ | |
28 | + if (vsi->info.pvid) | |
29 | + return; | |
30 | + | |
31 | if ((vsi->info.valid_sections & | |
32 | cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID)) && | |
33 | ((vsi->info.port_vlan_flags & I40E_AQ_VSI_PVLAN_MODE_MASK) == 0)) | |
34 | @@ -2293,6 +2297,10 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi) | |
35 | struct i40e_vsi_context ctxt; | |
36 | i40e_status ret; | |
37 | ||
38 | + /* Don't modify stripping options if a port VLAN is active */ | |
39 | + if (vsi->info.pvid) | |
40 | + return; | |
41 | + | |
42 | if ((vsi->info.valid_sections & | |
43 | cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID)) && | |
44 | ((vsi->info.port_vlan_flags & I40E_AQ_VSI_PVLAN_EMOD_MASK) == | |
45 | -- | |
46 | 2.20.1 | |
47 |