From: Herbert Xu Subject: [PATCH]: Fix netback skb accounting Date: Wed, 3 May 2006 21:16:16 +1000 Message-ID: <20060503111616.GA968@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: armbru@redhat.com, Xen Development Mailing List List-Id: xen-devel@lists.xenproject.org --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-netback-truesize.patch" diff -r decf309fb47b linux-2.6-xen-sparse/drivers/xen/netback/netback.c --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Tue May 02 17:23:21 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Wed May 03 21:14:13 2006 +1000 @@ -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); --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --yrj/dFKFPuw6o+aM--