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