NET: Fix GSO problems in dev_hard_start_xmit()
Subsystems (2)
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
@@ -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;
Quoted 9 lines · Michael Chan
Fix 2 problems in
dev_hard_start_xmit():1.
nskb->nextneeds to link back toskb->nextifhard_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 thenetif_queueis stopped.Signed-off-by Michael Chan <[email protected]>
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.txtFrom: 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->nextneeds to link back toskb->nextifhard_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 thenetif_queueis stopped.Signed-off-by Michael Chan <[email protected]>Good catch.
Acked-by Herbert Xu <[email protected]>
Applied, thanks.