From: Stefan Bader <stefan.bader@canonical.com>
To: Sander Eikelenboom <linux@eikelenboom.it>,
Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: xen-devel@lists.xenproject.org, netdev <netdev@vger.kernel.org>
Subject: Re: [Xen-devel] xen-netfront possibly rides the rocket too often
Date: Thu, 15 May 2014 11:03:01 +0200 [thread overview]
Message-ID: <537482C5.4060602@canonical.com> (raw)
In-Reply-To: <1721040118.20140515103816@eikelenboom.it>
[-- Attachment #1: Type: text/plain, Size: 2784 bytes --]
On 15.05.2014 10:38, Sander Eikelenboom wrote:
>
> Wednesday, May 14, 2014, 10:06:41 PM, you wrote:
>
>> 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.
>
> How does virtio-net handle this, the would probably have ran into the same problems ?
Maybe, though it seems not too many things cause this kind of traffic and then I
could not say whether they have to handle a limited set of ring pages, too. But
its something to keep in mind when digging deeper into it.
-Stefan
>
> --
> Sander
>
>> Zoli
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-05-15 9:03 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
2014-05-15 8:38 ` [Xen-devel] " Sander Eikelenboom
2014-05-15 9:03 ` Stefan Bader [this message]
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=537482C5.4060602@canonical.com \
--to=stefan.bader@canonical.com \
--cc=linux@eikelenboom.it \
--cc=netdev@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=zoltan.kiss@citrix.com \
/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).