From 746b9f0228a1c607b3db67c80da1c2a963321926 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 16 Jul 2008 20:15:45 -0700 Subject: netdrv intel: disable VLAN filtering in promiscous mode As discussed in this thread: http://www.mail-archive.com/netdev@vger.kernel.org/msg53976.html promiscous mode means to disable *all* filters. Currently only unicast and multicast filtering is disabled. This patch changes all Intel drivers to also disable VLAN filtering. Signed-off-by: Patrick McHardy Acked-by: Jeff Kirsher Acked-by: Peter P Waskiewicz Jr Signed-off-by: David S. Miller --- drivers/net/ixgb/ixgb_main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers/net/ixgb') diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index e83feaf830bd..ec95cd4ea588 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -1053,11 +1053,16 @@ ixgb_set_multi(struct net_device *netdev) if (netdev->flags & IFF_PROMISC) { rctl |= (IXGB_RCTL_UPE | IXGB_RCTL_MPE); - } else if (netdev->flags & IFF_ALLMULTI) { - rctl |= IXGB_RCTL_MPE; - rctl &= ~IXGB_RCTL_UPE; + rctl &= ~IXGB_RCTL_VFE; } else { - rctl &= ~(IXGB_RCTL_UPE | IXGB_RCTL_MPE); + if (netdev->flags & IFF_ALLMULTI) { + rctl |= IXGB_RCTL_MPE; + rctl &= ~IXGB_RCTL_UPE; + } else { + rctl &= ~(IXGB_RCTL_UPE | IXGB_RCTL_MPE); + } + if (adapter->vlgrp) + rctl |= IXGB_RCTL_VFE; } if (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { @@ -2104,7 +2109,8 @@ ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) /* enable VLAN receive filtering */ rctl = IXGB_READ_REG(&adapter->hw, RCTL); - rctl |= IXGB_RCTL_VFE; + if (!(netdev->flags & IFF_PROMISC)) + rctl |= IXGB_RCTL_VFE; rctl &= ~IXGB_RCTL_CFIEN; IXGB_WRITE_REG(&adapter->hw, RCTL, rctl); } else { -- cgit v1.2.3-59-g8ed1b