ignatenkobrain / rpms / kernel

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