Skip to contentSkip to conversation

NET: Fix GSO problems in dev_hard_start_xmit()

PATCH Applied Michael Chan 3 participants 3 messages Jun 25, 2006 – Jun 26, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NET: Fix GSO problems in dev_hard_start_xmit()

Fix 2 problems in dev_hard_start_xmit():

1. nskb->next needs to link back to skb->next if hard_start_xmit() returns non-zero.

2. Since the total number of GSO fragments may exceed MAX_SKB_FRAGS + 1, it needs to stop transmitting if the netif_queue is stopped.

net/core/dev.c +3 -0
index d293e0f..84e06ae 100644
@@ -1325,9 +1325,12 @@ int dev_hard_start_xmit(struct sk_buff *
 		nskb->next = NULL;
 		rc = dev->hard_start_xmit(nskb, dev);
 		if (unlikely(rc)) {
+			nskb->next = skb->next;
 			skb->next = nskb;
 			return rc;
 		}
+		if (unlikely(netif_queue_stopped(dev) && skb->next))
+			return NETDEV_TX_BUSY;
 	} while (skb->next);
 	
 	skb->destructor = DEV_GSO_CB(skb)->destructor;
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Michael Chan

Fix 2 problems in dev_hard_start_xmit():

1. nskb->next needs to link back to skb->next if hard_start_xmit() returns non-zero.

2. Since the total number of GSO fragments may exceed MAX_SKB_FRAGS + 1, it needs to stop transmitting if the netif_queue is stopped.

Good catch.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer Applied
#2 lore raw

From: Herbert Xu <[email protected]>
Date: Mon, 26 Jun 2006 09:36:02 +1000

Quoted 6 lines · Michael Chan
Quoted 5 lines

Fix 2 problems in dev_hard_start_xmit():

1. nskb->next needs to link back to skb->next if hard_start_xmit() returns non-zero.

Quoted 8 lines
Quoted 4 lines

2. Since the total number of GSO fragments may exceed MAX_SKB_FRAGS + 1, it needs to stop transmitting if the netif_queue is stopped.

Good catch.

Applied, thanks.