* [PATCH] tg3: Fix VLAN tag corruption
@ 2007-07-05 21:54 Matt Carlson
0 siblings, 0 replies; only message in thread
From: Matt Carlson @ 2007-07-05 21:54 UTC (permalink / raw)
To: jamal
Cc: Robert Olsson, Evgeniy Polyakov, Krishna Kumar2, Gagan Arneja,
netdev, Rick Jones, Sridhar Samudrala, David Miller, Jeff Garzik,
Michael Chan
This patch fixes a VLAN tag corruption bug introduced in the tx batching
modifications.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-05 21:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 21:54 [PATCH] tg3: Fix VLAN tag corruption Matt Carlson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).