]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
netdrv: don't truncate VLAN TCI with VLAN stripping
authorPatrick McHardy <kaber@trash.net>
Mon, 7 Jul 2008 03:48:41 +0000 (20:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Jul 2008 03:48:41 +0000 (20:48 -0700)
The vlan_hwaccel_{rx,receive_skb} functions expect the full TCI field
for priority mappings, don't truncate the upper 4 bits.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/e1000/e1000_main.c
drivers/net/e1000e/netdev.c
drivers/net/igb/igb_main.c
drivers/net/ixgb/ixgb_main.c
drivers/net/starfire.c
drivers/net/tehuti.c
drivers/net/tehuti.h

index 311ca266bd77ac62558f89069797d200acb5d668..7aa458f7d8b862c91471babc4ebe46232e5b9ec3 100644 (file)
@@ -4277,8 +4277,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
                if (unlikely(adapter->vlgrp &&
                            (status & E1000_RXD_STAT_VP))) {
                        vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                                                le16_to_cpu(rx_desc->special) &
-                                                E1000_RXD_SPC_VLAN_MASK);
+                                                le16_to_cpu(rx_desc->special));
                } else {
                        netif_receive_skb(skb);
                }
@@ -4286,8 +4285,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
                if (unlikely(adapter->vlgrp &&
                            (status & E1000_RXD_STAT_VP))) {
                        vlan_hwaccel_rx(skb, adapter->vlgrp,
-                                       le16_to_cpu(rx_desc->special) &
-                                       E1000_RXD_SPC_VLAN_MASK);
+                                       le16_to_cpu(rx_desc->special));
                } else {
                        netif_rx(skb);
                }
@@ -4464,16 +4462,14 @@ copydone:
 #ifdef CONFIG_E1000_NAPI
                if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) {
                        vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                               le16_to_cpu(rx_desc->wb.middle.vlan) &
-                               E1000_RXD_SPC_VLAN_MASK);
+                               le16_to_cpu(rx_desc->wb.middle.vlan));
                } else {
                        netif_receive_skb(skb);
                }
 #else /* CONFIG_E1000_NAPI */
                if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) {
                        vlan_hwaccel_rx(skb, adapter->vlgrp,
-                               le16_to_cpu(rx_desc->wb.middle.vlan) &
-                               E1000_RXD_SPC_VLAN_MASK);
+                               le16_to_cpu(rx_desc->wb.middle.vlan));
                } else {
                        netif_rx(skb);
                }
index acdd616c96f64865c91792b593c3e536b6305736..80592bdbe31e1e4e8d8cf069ab02b7e10d1e689d 100644 (file)
@@ -98,8 +98,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter,
 
        if (adapter->vlgrp && (status & E1000_RXD_STAT_VP))
                vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                                        le16_to_cpu(vlan) &
-                                        E1000_RXD_SPC_VLAN_MASK);
+                                        le16_to_cpu(vlan));
        else
                netif_receive_skb(skb);
 
index 7bc6fae182a7acf9116be4ce30845f400496fa1d..afd4ce3f7b53f0ac27141c06e888cca7d395c40f 100644 (file)
@@ -3391,8 +3391,7 @@ static void igb_receive_skb(struct igb_adapter *adapter, u8 status, __le16 vlan,
 {
        if (adapter->vlgrp && (status & E1000_RXD_STAT_VP))
                vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                                        le16_to_cpu(vlan) &
-                                        E1000_RXD_SPC_VLAN_MASK);
+                                        le16_to_cpu(vlan));
        else
                netif_receive_skb(skb);
 }
index cb8daddafa29376826affbe19d102c6bd73154fd..41f3adf5f375e805cf2a23cab8ef7629b9d808da 100644 (file)
@@ -2045,16 +2045,14 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
 #ifdef CONFIG_IXGB_NAPI
                if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) {
                        vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                               le16_to_cpu(rx_desc->special) &
-                                       IXGB_RX_DESC_SPECIAL_VLAN_MASK);
+                               le16_to_cpu(rx_desc->special));
                } else {
                        netif_receive_skb(skb);
                }
 #else /* CONFIG_IXGB_NAPI */
                if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) {
                        vlan_hwaccel_rx(skb, adapter->vlgrp,
-                               le16_to_cpu(rx_desc->special) &
-                                       IXGB_RX_DESC_SPECIAL_VLAN_MASK);
+                               le16_to_cpu(rx_desc->special));
                } else {
                        netif_rx(skb);
                }
index 7b7b1717b0d161e86d03da072a339a88dfef1d41..2038f38dc04b466977b0c2384959f3e3d88139f8 100644 (file)
@@ -1510,7 +1510,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                        if (debug > 4)
                                printk(KERN_DEBUG "  netdev_rx() vlanid = %d\n", le16_to_cpu(desc->vlanid));
                        /* vlan_netdev_receive_skb() expects a packet with the VLAN tag stripped out */
-                       vlan_netdev_receive_skb(skb, np->vlgrp, le16_to_cpu(desc->vlanid) & VLAN_VID_MASK);
+                       vlan_netdev_receive_skb(skb, np->vlgrp, le16_to_cpu(desc->vlanid));
                } else
 #endif /* VLAN_SUPPORT */
                        netdev_receive_skb(skb);
index 432e837a17607e323021da0d98dccdc310b1705e..91f9054a1d9522b5f60f0347d6264beeba8d4c60 100644 (file)
@@ -1165,7 +1165,7 @@ NETIF_RX_MUX(struct bdx_priv *priv, u32 rxd_val1, u16 rxd_vlan,
                                          GET_RXD_VLAN_ID(rxd_vlan))->name);
                /* NAPI variant of receive functions */
                vlan_hwaccel_receive_skb(skb, priv->vlgrp,
-                                        GET_RXD_VLAN_ID(rxd_vlan));
+                                        GET_RXD_VLAN_TCI(rxd_vlan));
        } else {
                netif_receive_skb(skb);
        }
index efd170f451b45161cbb621926c2a6820de3672a7..c66dfc9ec1ec691cd32e9013b651dde7074ffef0 100644 (file)
@@ -309,6 +309,7 @@ struct rxf_desc {
 #define GET_RXD_PKT_ID(x)              GET_BITS_SHIFT((x), 3, 28)
 #define GET_RXD_VTAG(x)                        GET_BITS_SHIFT((x), 1, 31)
 #define GET_RXD_VLAN_ID(x)             GET_BITS_SHIFT((x), 12, 0)
+#define GET_RXD_VLAN_TCI(x)            GET_BITS_SHIFT((x), 16, 0)
 #define GET_RXD_CFI(x)                 GET_BITS_SHIFT((x), 1, 12)
 #define GET_RXD_PRIO(x)                        GET_BITS_SHIFT((x), 3, 13)