netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jonathan Davies <Jonathan.Davies@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH net-next RFC 2/5] xen-netback: Change TX path from grant copy to mapping
Date: Fri, 1 Nov 2013 16:09:25 +0000	[thread overview]
Message-ID: <5273D235.3060100@citrix.com> (raw)
In-Reply-To: <527175DB.8070400@citrix.com>

On 30/10/13 21:10, Zoltan Kiss wrote:
> On 30/10/13 09:11, Paul Durrant wrote:
>>> +    err = alloc_xenballooned_pages(MAX_PENDING_REQS,
>>> +        vif->mmap_pages,
>>> +        false);
>>
>> Since this is a per-vif allocation, is this going to scale?
> Good question, I'll look after this.
I've talked to David Vrabel about this: if ballooning is disabled, this 
will reserve real memory, therefore for every VIF you allocate usually 
1MB memory. But if you enable ballooning, it will use pages which are 
not actually reserved, and that's fine, because we never gonna really 
use them. The only issue is that you need to set the maximum at boot 
time, and it will consume memory also because of the page table 
reservations.
The long term solution would be to just use a bunch of struct pages, 
David said the ballooning driver has something like that, but it's 
broken at the moment.

>>>           if (data_len < txp->size) {
>>>               /* Append the packet payload as a fragment. */
>>>               txp->offset += data_len;
>>>               txp->size -= data_len;
>>> -        } else {
>>> +            skb_shinfo(skb)->destructor_arg =
>>> +                &vif-
>>>> pending_tx_info[pending_idx].callback_struct;
>>> +        } else if (!skb_shinfo(skb)->nr_frags) {
>>>               /* Schedule a response immediately. */
>>> +            skb_shinfo(skb)->destructor_arg = NULL;
>>> +            xenvif_idx_unmap(vif, pending_idx);
>>>               xenvif_idx_release(vif, pending_idx,
>>>                          XEN_NETIF_RSP_OKAY);
>>> +        } else {
>>> +            /* FIXME: first request fits linear space, I don't know
>>> +             * if any guest would do that, but I think it's possible
>>> +             */
>>
>> The Windows frontend, because it has to parse the packet headers, will
>> coalesce everything up to the payload in a single frag and it would be
>> a good idea to copy this directly into the linear area.
> I forgot to clarify this comment: the problem I wanted to handle here if
> the first request's size is PKT_PROT_LEN and there is more fragments.
> Then skb->len will be PKT_PROT_LEN as well, and the if statement falls
> through to the else branch. That might be problematic if we release the
> slot of the first request separately from the others. Or am I
> overlooking something? Does that matter to netfront anyway?
> And this problem, if it's true, applies to the previous, grant copy
> method as well.
> However, as I think, it might be better to change the condition to
> (data_len <= txp->size), rather than putting an if-else statement into
> the else branch.
I've talked to Wei, we think this is a broken guest behaviour, and 
therefore we shouldn't care if someone does such a stupid thing.

Zoli

  reply	other threads:[~2013-11-01 16:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  0:50 [PATCH net-next RFC 0/5] xen-netback: TX grant mapping instead of copy Zoltan Kiss
2013-10-30  0:50 ` [PATCH net-next RFC 1/5] xen-netback: Introduce TX grant map definitions Zoltan Kiss
2013-10-30  9:28   ` [Xen-devel] " Jan Beulich
2013-10-31 19:22     ` Zoltan Kiss
2013-10-31 19:33   ` Zoltan Kiss
2013-10-30  0:50 ` [PATCH net-next RFC 2/5] xen-netback: Change TX path from grant copy to mapping Zoltan Kiss
2013-10-30  9:11   ` [Xen-devel] " Paul Durrant
2013-10-30 21:10     ` Zoltan Kiss
2013-11-01 16:09       ` Zoltan Kiss [this message]
2013-10-30  0:50 ` [PATCH net-next RFC 3/5] xen-netback: Remove old TX grant copy definitons Zoltan Kiss
2013-10-30  9:39   ` [Xen-devel] " Jan Beulich
2013-10-31 19:46     ` Zoltan Kiss
2013-10-30 11:13   ` Wei Liu
2013-10-30  0:50 ` [PATCH net-next RFC 4/5] xen-netback: Fix indentations Zoltan Kiss
2013-10-30 11:13   ` Wei Liu
2013-10-31 19:48     ` Zoltan Kiss
2013-10-30  0:50 ` [PATCH net-next RFC 4/5] xen-netback: Change RX path for mapped SKB fragments Zoltan Kiss
2013-10-30 19:16 ` [Xen-devel] [PATCH net-next RFC 0/5] xen-netback: TX grant mapping instead of copy Konrad Rzeszutek Wilk
2013-10-30 19:17   ` Konrad Rzeszutek Wilk
2013-10-30 21:14     ` Zoltan Kiss
2013-11-01 10:50 ` Ian Campbell
2013-11-01 19:00   ` Zoltan Kiss
2013-11-05 17:01     ` Zoltan Kiss
2013-11-07 10:52     ` Ian Campbell
2013-11-28 17:37       ` Zoltan Kiss
2013-11-28 17:43         ` Ian Campbell
2013-12-12 22:08           ` Zoltan Kiss
2013-12-16 10:14             ` Ian Campbell

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=5273D235.3060100@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Jonathan.Davies@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).