netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Eric Dumazet <eric.dumazet@gmail.com>, <netdev@vger.kernel.org>,
	<xen-devel@lists.xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Xen-devel] [3.15-rc3] Bisected: xen-netback mangles packets between two guests on a bridge since merge of "TX grant mapping with SKBTX_DEV_ZEROCOPY instead of copy" series.
Date: Fri, 2 May 2014 15:47:09 +0100	[thread overview]
Message-ID: <5363AFED.5080601@citrix.com> (raw)
In-Reply-To: <653156457.20140502160632@eikelenboom.it>

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

On 02/05/14 15:06, Sander Eikelenboom wrote:
>
> Friday, May 2, 2014, 4:00:40 PM, you wrote:
>
>>>> Let's see what that does different and if that gives an insight in what is going
>>>> wrong.
>>>
>>> The debug patch that i used is attached.
>>> Here is some of the output, skb->data_len size sometimes varies slightly as does skb->truesize (is that allowed to become > 64k ?).
>> Yes, truesize can be over 64K, as it includes the aligned size of the
>> data itself (64k max), struct skbuff and struct shared_info.
>> However my calculation for the truesize might be wrong: I count all the
>> frags as full sized pages (skb->truesize += i * PAGE_SIZE), but the last
>> page is not necessarily used entirely by that frag.
>> I had the idea that truesize should include the size of the whole page
>> as we reserved it with alloc_page for this skb, but it might not be true.
> Btw. with you "skb->>truesize -= nskb->data_len;" version truesize should
>> end up around 128k, something entirely wrong. Can you try with
> "skb->>truesize -= nskb->data_len;" in that line?
>> My repro env is underway in the meantime ...
>
> Erhmm i don't get this last part, first you entitle
> "skb->truesize -= nskb->data_len;" as being "entirely wrong" (which is probably true)
>
> Then you want me to try just that ? .. or did you mean something else ?

Sorry, I was misleading and wrong. Can you try out this scenario with 
the attached patch?

Thanks,

Zoli


[-- Attachment #2: truesize.patch --]
[-- Type: text/x-patch, Size: 1109 bytes --]

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 7666540..c761910 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1365,8 +1365,7 @@ static int xenvif_handle_frag_list(struct xenvif *vif, struct sk_buff *skb)
 	vif->tx_frag_overflow++;
 
 	xenvif_fill_frags(vif, nskb);
-	/* Subtract frags size, we will correct it later */
-	skb->truesize -= skb->data_len;
+	skb->truesize += nskb->len;
 	skb->len += nskb->len;
 	skb->data_len += nskb->len;
 
@@ -1379,7 +1378,6 @@ static int xenvif_handle_frag_list(struct xenvif *vif, struct sk_buff *skb)
 		page = alloc_page(GFP_ATOMIC|__GFP_COLD);
 		if (!page) {
 			int j;
-			skb->truesize += skb->data_len;
 			for (j = 0; j < i; j++)
 				put_page(frags[j].page.p);
 			return -ENOMEM;
@@ -1402,7 +1400,6 @@ static int xenvif_handle_frag_list(struct xenvif *vif, struct sk_buff *skb)
 	       frags,
 	       i * sizeof(skb_frag_t));
 	skb_shinfo(skb)->nr_frags = i;
-	skb->truesize += i * PAGE_SIZE;
 
 	/* remove traces of mapped pages and frag_list */
 	skb_frag_list_init(skb);

  reply	other threads:[~2014-05-02 14:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 10:45 [3.15-rc3] Bisected: xen-netback mangles packets between two guests on a bridge since merge of "TX grant mapping with SKBTX_DEV_ZEROCOPY instead of copy" series Sander Eikelenboom
2014-04-30 15:24 ` Eric Dumazet
2014-04-30 20:40   ` Zoltan Kiss
2014-04-30 20:53 ` Zoltan Kiss
2014-04-30 22:25   ` Sander Eikelenboom
2014-05-01 13:37     ` Zoltan Kiss
2014-05-01 13:59       ` Sander Eikelenboom
2014-05-01 15:46         ` Zoltan Kiss
2014-05-01 17:39           ` Sander Eikelenboom
2014-05-01 17:46             ` Eric Dumazet
2014-05-01 19:39             ` [Xen-devel] " Sander Eikelenboom
2014-05-02 14:00               ` Zoltan Kiss
2014-05-02 14:06                 ` Sander Eikelenboom
2014-05-02 14:47                   ` Zoltan Kiss [this message]
2014-05-02 15:21                     ` Eric Dumazet
2014-05-02 15:26                       ` Zoltan Kiss
2014-05-02 16:28                         ` Sander Eikelenboom
2014-05-02 16:45                           ` Zoltan Kiss
2014-05-05 10:19                             ` Sander Eikelenboom
2014-05-06 17:07                               ` Steven Haigh
2014-05-06 17:13                                 ` Zoltan Kiss
2014-05-06 17:37                                   ` Sander Eikelenboom
2014-05-06 18:07                                     ` Steven Haigh
2014-05-07  8:16                                       ` [Xen-devel] " David Vrabel
2014-05-16  2:13                                         ` Steven Haigh
2014-05-06 17:08                               ` [Xen-devel] " Zoltan Kiss
2014-05-06 17:10                               ` Zoltan Kiss
2014-05-06 17:33                                 ` Sander Eikelenboom
2014-05-01 13:49 ` Zoltan Kiss
2014-05-01 14:05   ` Sander Eikelenboom
2014-05-01 15:16     ` Zoltan Kiss
2014-05-01 15:40       ` Sander Eikelenboom
2014-05-02 15:35         ` Eric Dumazet
2014-05-02 22:18           ` Sander Eikelenboom
2014-05-09 22:19           ` Neal Cardwell
2014-05-09 21:02 ` Zoltan Kiss
2014-05-13 13:40   ` Zoltan Kiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5363AFED.5080601@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux@eikelenboom.it \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).