nxt5656 / rpms / kernel

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