diff options
author | Patrick McHardy <kaber@trash.net> | 2008-07-06 23:48:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-06 23:48:41 -0400 |
commit | 38b221957b155ef410bdc28856a66386303fbd5a (patch) | |
tree | 458006267c33308be8812a9def8eec7cbb23192a /drivers | |
parent | 4b5a698ef423eebc37cfacc6d3376d6dffd5bf83 (diff) |
netdrv: don't truncate VLAN TCI with VLAN stripping
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 12 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 3 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 6 | ||||
-rw-r--r-- | drivers/net/starfire.c | 2 | ||||
-rw-r--r-- | drivers/net/tehuti.c | 2 | ||||
-rw-r--r-- | drivers/net/tehuti.h | 1 |
7 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 311ca266bd77..7aa458f7d8b8 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -4277,8 +4277,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
4277 | if (unlikely(adapter->vlgrp && | 4277 | if (unlikely(adapter->vlgrp && |
4278 | (status & E1000_RXD_STAT_VP))) { | 4278 | (status & E1000_RXD_STAT_VP))) { |
4279 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 4279 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
4280 | le16_to_cpu(rx_desc->special) & | 4280 | le16_to_cpu(rx_desc->special)); |
4281 | E1000_RXD_SPC_VLAN_MASK); | ||
4282 | } else { | 4281 | } else { |
4283 | netif_receive_skb(skb); | 4282 | netif_receive_skb(skb); |
4284 | } | 4283 | } |
@@ -4286,8 +4285,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
4286 | if (unlikely(adapter->vlgrp && | 4285 | if (unlikely(adapter->vlgrp && |
4287 | (status & E1000_RXD_STAT_VP))) { | 4286 | (status & E1000_RXD_STAT_VP))) { |
4288 | vlan_hwaccel_rx(skb, adapter->vlgrp, | 4287 | vlan_hwaccel_rx(skb, adapter->vlgrp, |
4289 | le16_to_cpu(rx_desc->special) & | 4288 | le16_to_cpu(rx_desc->special)); |
4290 | E1000_RXD_SPC_VLAN_MASK); | ||
4291 | } else { | 4289 | } else { |
4292 | netif_rx(skb); | 4290 | netif_rx(skb); |
4293 | } | 4291 | } |
@@ -4464,16 +4462,14 @@ copydone: | |||
4464 | #ifdef CONFIG_E1000_NAPI | 4462 | #ifdef CONFIG_E1000_NAPI |
4465 | if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { | 4463 | if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { |
4466 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 4464 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
4467 | le16_to_cpu(rx_desc->wb.middle.vlan) & | 4465 | le16_to_cpu(rx_desc->wb.middle.vlan)); |
4468 | E1000_RXD_SPC_VLAN_MASK); | ||
4469 | } else { | 4466 | } else { |
4470 | netif_receive_skb(skb); | 4467 | netif_receive_skb(skb); |
4471 | } | 4468 | } |
4472 | #else /* CONFIG_E1000_NAPI */ | 4469 | #else /* CONFIG_E1000_NAPI */ |
4473 | if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { | 4470 | if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { |
4474 | vlan_hwaccel_rx(skb, adapter->vlgrp, | 4471 | vlan_hwaccel_rx(skb, adapter->vlgrp, |
4475 | le16_to_cpu(rx_desc->wb.middle.vlan) & | 4472 | le16_to_cpu(rx_desc->wb.middle.vlan)); |
4476 | E1000_RXD_SPC_VLAN_MASK); | ||
4477 | } else { | 4473 | } else { |
4478 | netif_rx(skb); | 4474 | netif_rx(skb); |
4479 | } | 4475 | } |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index acdd616c96f6..80592bdbe31e 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -98,8 +98,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter, | |||
98 | 98 | ||
99 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) | 99 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) |
100 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 100 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
101 | le16_to_cpu(vlan) & | 101 | le16_to_cpu(vlan)); |
102 | E1000_RXD_SPC_VLAN_MASK); | ||
103 | else | 102 | else |
104 | netif_receive_skb(skb); | 103 | netif_receive_skb(skb); |
105 | 104 | ||
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 7bc6fae182a7..afd4ce3f7b53 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -3391,8 +3391,7 @@ static void igb_receive_skb(struct igb_adapter *adapter, u8 status, __le16 vlan, | |||
3391 | { | 3391 | { |
3392 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) | 3392 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) |
3393 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 3393 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
3394 | le16_to_cpu(vlan) & | 3394 | le16_to_cpu(vlan)); |
3395 | E1000_RXD_SPC_VLAN_MASK); | ||
3396 | else | 3395 | else |
3397 | netif_receive_skb(skb); | 3396 | netif_receive_skb(skb); |
3398 | } | 3397 | } |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index cb8daddafa29..41f3adf5f375 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -2045,16 +2045,14 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter) | |||
2045 | #ifdef CONFIG_IXGB_NAPI | 2045 | #ifdef CONFIG_IXGB_NAPI |
2046 | if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) { | 2046 | if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) { |
2047 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 2047 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
2048 | le16_to_cpu(rx_desc->special) & | 2048 | le16_to_cpu(rx_desc->special)); |
2049 | IXGB_RX_DESC_SPECIAL_VLAN_MASK); | ||
2050 | } else { | 2049 | } else { |
2051 | netif_receive_skb(skb); | 2050 | netif_receive_skb(skb); |
2052 | } | 2051 | } |
2053 | #else /* CONFIG_IXGB_NAPI */ | 2052 | #else /* CONFIG_IXGB_NAPI */ |
2054 | if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) { | 2053 | if(adapter->vlgrp && (status & IXGB_RX_DESC_STATUS_VP)) { |
2055 | vlan_hwaccel_rx(skb, adapter->vlgrp, | 2054 | vlan_hwaccel_rx(skb, adapter->vlgrp, |
2056 | le16_to_cpu(rx_desc->special) & | 2055 | le16_to_cpu(rx_desc->special)); |
2057 | IXGB_RX_DESC_SPECIAL_VLAN_MASK); | ||
2058 | } else { | 2056 | } else { |
2059 | netif_rx(skb); | 2057 | netif_rx(skb); |
2060 | } | 2058 | } |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 7b7b1717b0d1..2038f38dc04b 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1510,7 +1510,7 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1510 | if (debug > 4) | 1510 | if (debug > 4) |
1511 | printk(KERN_DEBUG " netdev_rx() vlanid = %d\n", le16_to_cpu(desc->vlanid)); | 1511 | printk(KERN_DEBUG " netdev_rx() vlanid = %d\n", le16_to_cpu(desc->vlanid)); |
1512 | /* vlan_netdev_receive_skb() expects a packet with the VLAN tag stripped out */ | 1512 | /* vlan_netdev_receive_skb() expects a packet with the VLAN tag stripped out */ |
1513 | vlan_netdev_receive_skb(skb, np->vlgrp, le16_to_cpu(desc->vlanid) & VLAN_VID_MASK); | 1513 | vlan_netdev_receive_skb(skb, np->vlgrp, le16_to_cpu(desc->vlanid)); |
1514 | } else | 1514 | } else |
1515 | #endif /* VLAN_SUPPORT */ | 1515 | #endif /* VLAN_SUPPORT */ |
1516 | netdev_receive_skb(skb); | 1516 | netdev_receive_skb(skb); |
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c index 432e837a1760..91f9054a1d95 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -1165,7 +1165,7 @@ NETIF_RX_MUX(struct bdx_priv *priv, u32 rxd_val1, u16 rxd_vlan, | |||
1165 | GET_RXD_VLAN_ID(rxd_vlan))->name); | 1165 | GET_RXD_VLAN_ID(rxd_vlan))->name); |
1166 | /* NAPI variant of receive functions */ | 1166 | /* NAPI variant of receive functions */ |
1167 | vlan_hwaccel_receive_skb(skb, priv->vlgrp, | 1167 | vlan_hwaccel_receive_skb(skb, priv->vlgrp, |
1168 | GET_RXD_VLAN_ID(rxd_vlan)); | 1168 | GET_RXD_VLAN_TCI(rxd_vlan)); |
1169 | } else { | 1169 | } else { |
1170 | netif_receive_skb(skb); | 1170 | netif_receive_skb(skb); |
1171 | } | 1171 | } |
diff --git a/drivers/net/tehuti.h b/drivers/net/tehuti.h index efd170f451b4..c66dfc9ec1ec 100644 --- a/drivers/net/tehuti.h +++ b/drivers/net/tehuti.h | |||
@@ -309,6 +309,7 @@ struct rxf_desc { | |||
309 | #define GET_RXD_PKT_ID(x) GET_BITS_SHIFT((x), 3, 28) | 309 | #define GET_RXD_PKT_ID(x) GET_BITS_SHIFT((x), 3, 28) |
310 | #define GET_RXD_VTAG(x) GET_BITS_SHIFT((x), 1, 31) | 310 | #define GET_RXD_VTAG(x) GET_BITS_SHIFT((x), 1, 31) |
311 | #define GET_RXD_VLAN_ID(x) GET_BITS_SHIFT((x), 12, 0) | 311 | #define GET_RXD_VLAN_ID(x) GET_BITS_SHIFT((x), 12, 0) |
312 | #define GET_RXD_VLAN_TCI(x) GET_BITS_SHIFT((x), 16, 0) | ||
312 | #define GET_RXD_CFI(x) GET_BITS_SHIFT((x), 1, 12) | 313 | #define GET_RXD_CFI(x) GET_BITS_SHIFT((x), 1, 12) |
313 | #define GET_RXD_PRIO(x) GET_BITS_SHIFT((x), 3, 13) | 314 | #define GET_RXD_PRIO(x) GET_BITS_SHIFT((x), 3, 13) |
314 | 315 | ||