fanghuilin / rpms / kernel

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