This patch fixes a VLAN tag corruption bug introduced in the tx batching modifications.
Signed-off-by: Matt Carlson <[EMAIL PROTECTED]> Signed-off-by: Michael Chan <[EMAIL PROTECTED]> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index be03cbd..cef9cbe 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -3896,8 +3896,15 @@ struct tg3_tx_cbdata { static int tg3_prep_bug_frame(struct sk_buff *skb, struct net_device *dev) { struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb); + struct tg3 *tp = netdev_priv(dev); + u32 vlantag = 0; + +#if TG3_VLAN_TAG_USED + if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) + vlantag = (TXD_FLAG_VLAN | (vlan_tx_tag_get(skb) << 16)); +#endif - cb->base_flags = 0; + cb->base_flags = vlantag; cb->mss = skb_shinfo(skb)->gso_size; if (cb->mss != 0) { if (skb_header_cloned(skb) && @@ -3919,8 +3926,15 @@ static int tg3_prep_bug_frame(struct sk_buff *skb, struct net_device *dev) static int tg3_prep_frame(struct sk_buff *skb, struct net_device *dev) { struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb); + struct tg3 *tp = netdev_priv(dev); + u32 vlantag = 0; + +#if TG3_VLAN_TAG_USED + if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) + vlantag = (TXD_FLAG_VLAN | (vlan_tx_tag_get(skb) << 16)); +#endif - cb->base_flags = 0; + cb->base_flags = vlantag; cb->mss = skb_shinfo(skb)->gso_size; if (cb->mss != 0) { int tcp_opt_len, ip_tcp_len; @@ -3985,13 +3999,6 @@ static int tg3_enqueue(struct sk_buff *skb, struct net_device *dev) u32 len, entry; struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb); - -#if TG3_VLAN_TAG_USED - if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) - cb->base_flags |= (TXD_FLAG_VLAN | - (vlan_tx_tag_get(skb) << 16)); -#endif - entry = tp->tx_prod; len = skb_headlen(skb); /* Queue skb data, a.k.a. the main skb fragment. */ @@ -4187,11 +4194,6 @@ static int tg3_enqueue_buggy(struct sk_buff *skb, struct net_device *dev) } } } -#if TG3_VLAN_TAG_USED - if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) - cb->base_flags |= (TXD_FLAG_VLAN | - (vlan_tx_tag_get(skb) << 16)); -#endif len = skb_headlen(skb); entry = tp->tx_prod; - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html