Patchwork [net,2/2] igb: fix vlan filtering in promisc mode when not in VT mode

login
register
mail settings
Submitter Jeff Kirsher
Date July 26, 2013, 12:46 p.m.
Message ID <1374842796-28445-2-git-send-email-jeffrey.t.kirsher@intel.com>
Download mbox | patch
Permalink /patch/262152/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jeff Kirsher - July 26, 2013, 12:46 p.m.
From: Emil Tantilov <emil.s.tantilov@intel.com>

This patch fixes a VT mode check to make sure VLAN filters are disabled when
in promisc mode and VT is not enabled.

The problem with the previous check was that:
E1000_MRQC_ENABLE_VMDQ is defined as 0x00000003

but when not in VT mode:
mrqc |= E1000_MRQC_ENABLE_RSS_4Q (0x00000002)

So the above check will trigger regardless if VT mode is being used or not.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
David Miller - July 28, 2013, 8:17 p.m.
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 26 Jul 2013 05:46:36 -0700

> From: Emil Tantilov <emil.s.tantilov@intel.com>
> 
> This patch fixes a VT mode check to make sure VLAN filters are disabled when
> in promisc mode and VT is not enabled.
> 
> The problem with the previous check was that:
> E1000_MRQC_ENABLE_VMDQ is defined as 0x00000003
> 
> but when not in VT mode:
> mrqc |= E1000_MRQC_ENABLE_RSS_4Q (0x00000002)
> 
> So the above check will trigger regardless if VT mode is being used or not.
> 
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 6a0c1b6..c1d72c0 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3739,9 +3739,8 @@  static void igb_set_rx_mode(struct net_device *netdev)
 	rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE);
 
 	if (netdev->flags & IFF_PROMISC) {
-		u32 mrqc = rd32(E1000_MRQC);
 		/* retain VLAN HW filtering if in VT mode */
-		if (mrqc & E1000_MRQC_ENABLE_VMDQ)
+		if (adapter->vfs_allocated_count)
 			rctl |= E1000_RCTL_VFE;
 		rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
 		vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME);