]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ixgbe: fix tag stripping for VLAN ID 0
authorDon Skidmore <donald.c.skidmore@intel.com>
Tue, 20 Jan 2009 00:54:36 +0000 (16:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jan 2009 00:54:36 +0000 (16:54 -0800)
Register VLAN ID 0 so that frames with VLAN ID 0 are received and get
their tag stripped when ixgbe is not in DCB mode.  VLAN ID 0 means
that the frame is 'priority tagged' only - it is not a VLAN, but the
priority value is the tag in valid.  The functions
ixgbe_vlan_rx_register() and ixgbe_vlan_rx_kill_vid() were moved up a
couple functions to correct compiling issues with this change.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbe/ixgbe_main.c

index 92d9b17a081a93248e5869fb4f1f187019bae6b5..bf36737e2ec71a488451c1c36e46b14b514134f7 100644 (file)
@@ -1744,6 +1744,32 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
        IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
 }
 
+static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(netdev);
+       struct ixgbe_hw *hw = &adapter->hw;
+
+       /* add VID to filter table */
+       hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true);
+}
+
+static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(netdev);
+       struct ixgbe_hw *hw = &adapter->hw;
+
+       if (!test_bit(__IXGBE_DOWN, &adapter->state))
+               ixgbe_irq_disable(adapter);
+
+       vlan_group_set_device(adapter->vlgrp, vid, NULL);
+
+       if (!test_bit(__IXGBE_DOWN, &adapter->state))
+               ixgbe_irq_enable(adapter);
+
+       /* remove VID from filter table */
+       hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false);
+}
+
 static void ixgbe_vlan_rx_register(struct net_device *netdev,
                                    struct vlan_group *grp)
 {
@@ -1763,6 +1789,7 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev,
        ctrl |= IXGBE_VLNCTRL_VME;
        ctrl &= ~IXGBE_VLNCTRL_CFIEN;
        IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
+       ixgbe_vlan_rx_add_vid(netdev, 0);
 
        if (grp) {
                /* enable VLAN tag insert/strip */
@@ -1776,32 +1803,6 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev,
                ixgbe_irq_enable(adapter);
 }
 
-static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
-{
-       struct ixgbe_adapter *adapter = netdev_priv(netdev);
-       struct ixgbe_hw *hw = &adapter->hw;
-
-       /* add VID to filter table */
-       hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true);
-}
-
-static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
-{
-       struct ixgbe_adapter *adapter = netdev_priv(netdev);
-       struct ixgbe_hw *hw = &adapter->hw;
-
-       if (!test_bit(__IXGBE_DOWN, &adapter->state))
-               ixgbe_irq_disable(adapter);
-
-       vlan_group_set_device(adapter->vlgrp, vid, NULL);
-
-       if (!test_bit(__IXGBE_DOWN, &adapter->state))
-               ixgbe_irq_enable(adapter);
-
-       /* remove VID from filter table */
-       hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false);
-}
-
 static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
 {
        ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp);