From: Ian Campbell Subject: Re: [Linux 3.7-rc8] DomU: WARNING: at net/core/skbuff.c:3444 skb_try_coalesce+0x359/0x390() Date: Mon, 10 Dec 2012 15:12:18 +0000 Message-ID: <1355152338.21160.37.camel@zakaz.uk.xensource.com> References: <1259250907.20121208211402@eikelenboom.it> <50C4A8FD.5070407@oracle.com> <341064135.20121209223602@eikelenboom.it> <101480918.20121210160332@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <101480918.20121210160332@eikelenboom.it> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Sander Eikelenboom Cc: Konrad Rzeszutek Wilk , annie li , Eric Dumazet , xen-devel List-Id: xen-devel@lists.xenproject.org I wrote > > I have a vague recollection of a patch to set skb->truesize more > > accurately in xennet_poll (netfront), but I can't seem to find any > > reference to it now. I finally found the following in my git tree. Looks like I never sent it out. Does it help? 8<-------------------- >From 788ba317fa241512be7a8630b1b58e53faff83ed Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 22 Aug 2012 11:55:31 +0100 Subject: [PATCH] xen/netfront: improve truesize tracking Fixes WARN_ON from skb_try_coalesce. Signed-off-by: Ian Campbell --- drivers/net/xen-netfront.c | 15 +++++---------- net/core/skbuff.c | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index caa0110..b06ef81 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -971,17 +971,12 @@ err: * overheads. Here, we add the size of the data pulled * in xennet_fill_frags(). * - * We also adjust for any unused space in the main - * data area by subtracting (RX_COPY_THRESHOLD - - * len). This is especially important with drivers - * which split incoming packets into header and data, - * using only 66 bytes of the main data area (see the - * e1000 driver for example.) On such systems, - * without this last adjustement, our achievable - * receive throughout using the standard receive - * buffer size was cut by 25%(!!!). + * We also adjust for the __pskb_pull_tail done in + * handle_incoming_queue which pulls data from the + * frags into the head area, which is already + * accounted in RX_COPY_THRESHOLD. */ - skb->truesize += skb->data_len - RX_COPY_THRESHOLD; + skb->truesize += skb->data_len - NETFRONT_SKB_CB(skb)->pull_to; skb->len += skb->data_len; if (rx->flags & XEN_NETRXF_csum_blank) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6e04b1f..941a974 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3439,7 +3439,7 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, delta = from->truesize - SKB_TRUESIZE(skb_end_offset(from)); } - WARN_ON_ONCE(delta < len); + WARN_ONCE(delta < len, "delta %d < len %d\n", delta, len); memcpy(skb_shinfo(to)->frags + skb_shinfo(to)->nr_frags, skb_shinfo(from)->frags, -- 1.7.2.5