Skip to contentSkip to conversation

: Fix netback skb accounting

PATCH New Herbert Xu 1 participant 1 message May 3, 2006

lore
Share & tools
lore

Herbert Xu

author
#0 lore raw

PATCH 1/1 : Fix netback skb accounting

Hi:

When you generate non-linear skb's as netback does, it is up to you to ensure that truesize reflects the size of paged part of the skb. Otherwise socket memory accounting in Linux falls apart.

Thanks to the new check that David Miller added to TCP we were able to catch this bug.

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
linux-2.6-xen-sparse/drivers/xen/netback/netback.c +1 -0
diff -r decf309fb47b linux-2.6-xen-sparse/drivers/xen/netback/netback.c
@@ -659,6 +659,7 @@ static void net_tx_action(unsigned long 
 
 		skb->data_len  = txreq.size - data_len;
 		skb->len      += skb->data_len;
+		skb->truesize += skb->data_len;
 
 		skb->dev      = netif->dev;
 		skb->protocol = eth_type_trans(skb, skb->dev);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel