]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.181/i40e-don-t-allow-changes-to-hw-vlan-stripping-on-act.patch
Linux 4.4.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / i40e-don-t-allow-changes-to-hw-vlan-stripping-on-act.patch
CommitLineData
1143c684
SL
1From 9f6d2507384f998d0579495bdf59adecef23181a Mon Sep 17 00:00:00 2001
2From: Nicholas Nunley <nicholas.d.nunley@intel.com>
3Date: Wed, 6 Feb 2019 15:08:17 -0800
4Subject: i40e: don't allow changes to HW VLAN stripping on active port VLANs
5
6[ Upstream commit bfb0ebed53857cfc57f11c63fa3689940d71c1c8 ]
7
8Modifying the VLAN stripping options when a port VLAN is configured
9will break traffic for the VSI, and conceptually doesn't make sense,
10so don't allow this.
11
12Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
13Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
14Signed-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
19diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
20index 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--
462.20.1
47