All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
@ 2016-08-11 21:51 Alexander Duyck
  2016-08-11 21:59 ` Duyck, Alexander H
  2016-08-12 22:47 ` Bowers, AndrewX
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Duyck @ 2016-08-11 21:51 UTC (permalink / raw)
  To: intel-wired-lan

When I was adding the code for enabling VLAN promiscuous mode with SR-IOV
enabled I had inadvertently left the VLNCTRL.VFE bit unchanged as I has
assumed there was code in another path that was setting it when we enabled
SR-IOV.  This wasn't the case and as a result we were just disabling VLAN
filtering for all the VFs apparently.

Also the previous patches were always clearing CFIEN which was always set
to 0 by the hardware anyway so I am dropping the redundant bit clearing.

Fixes: 16369564915a ("ixgbe: Add support for VLAN promiscuous with SR-IOV")
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index e06ca55..fa7fa09 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4102,6 +4102,8 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
 	struct ixgbe_hw *hw = &adapter->hw;
 	u32 vlnctrl, i;
 
+	vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
+
 	switch (hw->mac.type) {
 	case ixgbe_mac_82599EB:
 	case ixgbe_mac_X540:
@@ -4114,8 +4116,7 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
 		/* fall through */
 	case ixgbe_mac_82598EB:
 		/* legacy case, we can just disable VLAN filtering */
-		vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
-		vlnctrl &= ~(IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
+		vlnctrl &= ~IXGBE_VLNCTRL_VFE;
 		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
 		return;
 	}
@@ -4127,6 +4128,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
 	/* Set flag so we don't redo unnecessary work */
 	adapter->flags2 |= IXGBE_FLAG2_VLAN_PROMISC;
 
+	/* For VMDq and SR-IOV we must leave VLAN filtering enabled */
+	vlnctrl |= IXGBE_VLNCTRL_VFE;
+	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
+
 	/* Add PF to all active pools */
 	for (i = IXGBE_VLVF_ENTRIES; --i;) {
 		u32 reg_offset = IXGBE_VLVFB(i * 2 + VMDQ_P(0) / 32);
@@ -4193,6 +4198,11 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
 	struct ixgbe_hw *hw = &adapter->hw;
 	u32 vlnctrl, i;
 
+	/* Set VLAN filtering to enabled */
+	vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
+	vlnctrl |= IXGBE_VLNCTRL_VFE;
+	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
+
 	switch (hw->mac.type) {
 	case ixgbe_mac_82599EB:
 	case ixgbe_mac_X540:
@@ -4204,10 +4214,6 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
 			break;
 		/* fall through */
 	case ixgbe_mac_82598EB:
-		vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
-		vlnctrl &= ~IXGBE_VLNCTRL_CFIEN;
-		vlnctrl |= IXGBE_VLNCTRL_VFE;
-		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
 		return;
 	}
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
  2016-08-11 21:51 [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths Alexander Duyck
@ 2016-08-11 21:59 ` Duyck, Alexander H
  2016-08-12 22:47 ` Bowers, AndrewX
  1 sibling, 0 replies; 3+ messages in thread
From: Duyck, Alexander H @ 2016-08-11 21:59 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2016-08-11 at 14:51 -0700, Alexander Duyck wrote:
> When I was adding the code for enabling VLAN promiscuous mode with
> SR-IOV
> enabled I had inadvertently left the VLNCTRL.VFE bit unchanged as I
> has
> assumed there was code in another path that was setting it when we
> enabled
> SR-IOV.??This wasn't the case and as a result we were just disabling
> VLAN
> filtering for all the VFs apparently.
> 
> Also the previous patches were always clearing CFIEN which was always
> set
> to 0 by the hardware anyway so I am dropping the redundant bit
> clearing.
> 
> Fixes: 16369564915a ("ixgbe: Add support for VLAN promiscuous with
> SR-IOV")
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Hey Jeff,

I'm still working out the kinks of setting up yet another devel system,
otherwise I would have flagged this as being for the net queue. ?If you
need I can resubmit the patch, but I figure I will wait until you say
it is necessary.

Also I added a "Fixes:" line as this will need to be ported back into
several stable trees. ?It is a bug that Email found in the VLAN patches
I submitted for ixgbe a little while back.

Thanks.

- Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
  2016-08-11 21:51 [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths Alexander Duyck
  2016-08-11 21:59 ` Duyck, Alexander H
@ 2016-08-12 22:47 ` Bowers, AndrewX
  1 sibling, 0 replies; 3+ messages in thread
From: Bowers, AndrewX @ 2016-08-12 22:47 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Alexander Duyck
> Sent: Thursday, August 11, 2016 2:52 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all
> VMDq paths
> 
> When I was adding the code for enabling VLAN promiscuous mode with SR-
> IOV enabled I had inadvertently left the VLNCTRL.VFE bit unchanged as I has
> assumed there was code in another path that was setting it when we
> enabled SR-IOV.  This wasn't the case and as a result we were just disabling
> VLAN filtering for all the VFs apparently.
> 
> Also the previous patches were always clearing CFIEN which was always set
> to 0 by the hardware anyway so I am dropping the redundant bit clearing.
> 
> Fixes: 16369564915a ("ixgbe: Add support for VLAN promiscuous with SR-
> IOV")
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-12 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 21:51 [Intel-wired-lan] [PATCH] ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths Alexander Duyck
2016-08-11 21:59 ` Duyck, Alexander H
2016-08-12 22:47 ` Bowers, AndrewX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.