589f80
centosplus patch [bug#12653]
589f80
589f80
commit	f60439bc21e3337429838e477903214f5bd8277f
589f80
589f80
ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
589f80
When I was adding the code for enabling VLAN promiscuous mode with SR-IOV
589f80
enabled I had inadvertently left the VLNCTRL.VFE bit unchanged as I has
589f80
assumed there was code in another path that was setting it when we enabled
589f80
SR-IOV.  This wasn't the case and as a result we were just disabling VLAN
589f80
filtering for all the VFs apparently.
589f80
589f80
Also the previous patches were always clearing CFIEN which was always set
589f80
to 0 by the hardware anyway so I am dropping the redundant bit clearing.
589f80
589f80
Fixes: 16369564915a ("ixgbe: Add support for VLAN promiscuous with SR-IOV")
589f80
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
589f80
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
589f80
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
589f80
589f80
Applied-by: Akemi Yagi <toracat@centos.org>
589f80
589f80
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c	2016-11-16 09:52:06.000000000 -0800
589f80
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c	2017-01-14 07:54:51.280709835 -0800
589f80
@@ -4066,6 +4066,8 @@ static void ixgbe_vlan_promisc_enable(st
589f80
 	struct ixgbe_hw *hw = &adapter->hw;
589f80
 	u32 vlnctrl, i;
589f80
 
589f80
+	vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
589f80
+
589f80
 	switch (hw->mac.type) {
589f80
 	case ixgbe_mac_82599EB:
589f80
 	case ixgbe_mac_X540:
589f80
@@ -4078,8 +4080,7 @@ static void ixgbe_vlan_promisc_enable(st
589f80
 		/* fall through */
589f80
 	case ixgbe_mac_82598EB:
589f80
 		/* legacy case, we can just disable VLAN filtering */
589f80
-		vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
589f80
-		vlnctrl &= ~(IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
589f80
+		vlnctrl &= ~IXGBE_VLNCTRL_VFE;
589f80
 		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
589f80
 		return;
589f80
 	}
589f80
@@ -4091,6 +4092,10 @@ static void ixgbe_vlan_promisc_enable(st
589f80
 	/* Set flag so we don't redo unnecessary work */
589f80
 	adapter->flags2 |= IXGBE_FLAG2_VLAN_PROMISC;
589f80
 
589f80
+	/* For VMDq and SR-IOV we must leave VLAN filtering enabled */
589f80
+	vlnctrl |= IXGBE_VLNCTRL_VFE;
589f80
+	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
589f80
+
589f80
 	/* Add PF to all active pools */
589f80
 	for (i = IXGBE_VLVF_ENTRIES; --i;) {
589f80
 		u32 reg_offset = IXGBE_VLVFB(i * 2 + VMDQ_P(0) / 32);
589f80
@@ -4157,6 +4162,11 @@ static void ixgbe_vlan_promisc_disable(s
589f80
 	struct ixgbe_hw *hw = &adapter->hw;
589f80
 	u32 vlnctrl, i;
589f80
 
589f80
+	/* Set VLAN filtering to enabled */
589f80
+	vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
589f80
+	vlnctrl |= IXGBE_VLNCTRL_VFE;
589f80
+	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
589f80
+
589f80
 	switch (hw->mac.type) {
589f80
 	case ixgbe_mac_82599EB:
589f80
 	case ixgbe_mac_X540:
589f80
@@ -4168,10 +4178,6 @@ static void ixgbe_vlan_promisc_disable(s
589f80
 			break;
589f80
 		/* fall through */
589f80
 	case ixgbe_mac_82598EB:
589f80
-		vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
589f80
-		vlnctrl &= ~IXGBE_VLNCTRL_CFIEN;
589f80
-		vlnctrl |= IXGBE_VLNCTRL_VFE;
589f80
-		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
589f80
 		return;
589f80
 	}
589f80