From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Stefan Bader <stefan.bader@canonical.com>,
<xen-devel@lists.xenproject.org>, netdev <netdev@vger.kernel.org>
Subject: Re: xen-netfront possibly rides the rocket too often
Date: Wed, 14 May 2014 21:06:41 +0100 [thread overview]
Message-ID: <5373CCD1.4050509@citrix.com> (raw)
In-Reply-To: <5373C8D4.2010803@citrix.com>
On 14/05/14 20:49, Zoltan Kiss wrote:
> On 13/05/14 19:21, Stefan Bader wrote:
>> Since I am not deeply familiar with the networking code, I wonder
>> about two things:
>> - is there something that should limit the skb data length from all frags
>> to stay below the 64K which the definition of MAX_SKB_FRAGS hints?
> I think netfront should be able to handle 64K packets at most.
>> - is multiple frags having offsets expected?
> Yes, since compound pages a frag could over the 4K page boundary. The
> problem is, that in the netback/front protocol the assumption is that
> every slot is a single page, because grant operations could be done only
> on a 4K page. And every slot ends up as a frag (expect maybe the first,
> it can happen it is grant copied straight to the linear buffer),
> therefore the frontend cannot send an skb which occupies more than
> MAX_SKB_FRAGS individual 4k page.
> The problem is known for a while, the solution is not, unfortunately.
I think the worst case scenario is when every frag and the linear buffer
contains 2 bytes, which are overlapping a page boundary (that's
(17+1)*2=36 so far), plus 15 of them have a 4k page in the middle of
them, so, a 1+4096+1 byte buffer can span over 3 page. That's 51
individual pages.
With the previous grant copy implementation there would be the option to
modify backend and coalesce everything into a well formed skb. That
would be a minor change there. But with grant mapping it's harder.
Slots of compound pages could be mapped to adjacent pages to Dom0, maybe
somehow you can present them as compound pages in Dom0 as well. But in
MFN space they wouldn't be contiguous, you need SWIOTLB or use IOMMU to
hide that from the devices. Plus, what happens when you can't find
adjacent pending slots?
I think we would be better off at the moment with trying to compact
these skbs a bit. Usually they overflow the limit by one or two, which
means we should reallocate one or two frag, or the linear buffer to
decrease the number of 4K pages used.
Zoli
next prev parent reply other threads:[~2014-05-14 20:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 18:21 xen-netfront possibly rides the rocket too often Stefan Bader
2014-05-14 19:49 ` Zoltan Kiss
2014-05-14 20:06 ` Zoltan Kiss [this message]
2014-05-15 8:38 ` [Xen-devel] " Sander Eikelenboom
2014-05-15 9:03 ` Stefan Bader
2014-05-15 8:46 ` Ian Campbell
2014-05-15 8:58 ` Stefan Bader
2014-05-15 9:38 ` Sander Eikelenboom
2014-05-15 11:04 ` Wei Liu
2014-05-15 11:14 ` David Laight
2014-05-15 11:47 ` Ian Campbell
2014-05-15 12:14 ` Stefan Bader
2014-05-16 9:48 ` Wei Liu
2014-05-16 9:57 ` Wei Liu
2014-05-16 10:05 ` David Laight
2014-05-16 10:22 ` Wei Liu
2014-05-16 10:09 ` Stefan Bader
2014-05-16 10:17 ` Stefan Bader
2014-05-16 10:32 ` Wei Liu
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=5373CCD1.4050509@citrix.com \
--to=zoltan.kiss@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=stefan.bader@canonical.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).