From: Rusty Russell <rusty@rustcorp.com.au>
To: dlaor@redhat.com
Cc: Mark McLoughlin <markmc@redhat.com>, Dor Laor <dor@redhat.com>,
virtualization@lists.linux-foundation.org,
Avi Kivity <avi@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC)
Date: Mon, 4 May 2009 11:49:00 +0930 [thread overview]
Message-ID: <200905041149.00724.rusty@rustcorp.com.au> (raw)
In-Reply-To: <49F56239.9010509@redhat.com>
On Mon, 27 Apr 2009 05:13:53 pm Dor Laor wrote:
> Mark McLoughlin wrote:
> > Hi Rusty,
> >
> > On Thu, 2008-12-18 at 17:10 +0000, Mark McLoughlin wrote:
> >
> >> Add a new feature flag for indirect ring entries. These are ring
> >> entries which point to a table of buffer descriptors.
> >>
> >> The idea here is to increase the ring capacity by allowing a larger
> >> effective ring size whereby the ring size dictates the number of
> >> requests that may be outstanding, rather than the size of those
> >> requests.
OK, just so we track our mistakes.
1) virtio_rings must be physically contiguous, even though they actually
have two independent parts.
2) The number of elements in a ring must be a power of 2.
3) virtio_pci tells the guest what number of elements to use.
4) The guest has to allocate that much physically contiguous memory, or fail.
In practice, 128 elements = 2 pages, 256 elements = 3 pages, 512 elements
= 5 pages. Order 1, order 2, order 3 under Linux. 1 is OK, 2 is iffy, 3 is
hard.
Blocked from doing the simpler thing, we've decided to go with a layer
of indirection. But the patch is simple and clean, so there's nothing
fundamental to object to.
I can't find 3/3, did it go missing?
Thanks,
Rusty.
> >>
> >> This should be most effective in the case of block I/O where we can
> >> potentially benefit by concurrently dispatching a large number of
> >> large requests. Even in the simple case of single segment block
> >> requests, this results in a threefold increase in ring capacity.
> >>
> >
> > Apparently, this would also be useful for the windows virtio-net
> > drivers.
> >
> > Dor can explain further, but apparently Windows has been observed
> > passing the driver a packet with >256 fragments when using TSO.
> >
> > With a ring size of 256, the guest can either drop the packet or copy it
> > into a single buffer. We'd much rather if we could use an indirect ring
> > entry to pass this number of fragments without copying.
> >
> Correct. This is what we do in Windows today.
> The problem arises when using sending lots of small packets
> from the win guest and TSO. Windows prepare very big scatter gather
> list, bigger than the ring size (270 fragments).
> Having indirect ring entries is good both for this and also for block
> io, as described
> above.
>
> Cheers,
> Dor
> > For reference the original patch was here:
> >
> > http://lkml.org/lkml/2008/12/18/212
> >
> > Cheers,
> > Mark.
> >
> > _______________________________________________
> > Virtualization mailing list
> > Virtualization@lists.linux-foundation.org
> > https://lists.linux-foundation.org/mailman/listinfo/virtualization
> >
>
next prev parent reply other threads:[~2009-05-04 2:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1229620222-22216-1-git-send-email-markmc@redhat.com>
[not found] ` <1229620222-22216-2-git-send-email-markmc@redhat.com>
[not found] ` <1229620222-22216-3-git-send-email-markmc@redhat.com>
2008-12-20 11:38 ` [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC) Ingo Oeser
[not found] ` <200812201238.07510.ioe-lkml@rameria.de>
2008-12-22 10:17 ` Mark McLoughlin
2009-04-21 12:59 ` Mark McLoughlin
[not found] ` <1240318745.443.42.camel@blaa>
2009-04-27 7:43 ` Dor Laor
2009-05-04 2:19 ` Rusty Russell [this message]
2009-05-11 17:10 ` Mark McLoughlin
[not found] ` <1242061838.25337.8.camel@blaa>
2009-05-12 14:23 ` Rusty Russell
2009-05-17 2:04 ` Rusty Russell
[not found] ` <200905171134.31285.rusty@rustcorp.com.au>
2009-05-17 6:27 ` Avi Kivity
[not found] ` <4A0FAE35.3040608@redhat.com>
2009-05-17 14:16 ` Rusty Russell
[not found] ` <200905172346.14498.rusty@rustcorp.com.au>
2009-05-17 15:05 ` Avi Kivity
[not found] ` <4A1027C3.3080109@redhat.com>
2009-05-19 8:15 ` Rusty Russell
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=200905041149.00724.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=avi@redhat.com \
--cc=dlaor@redhat.com \
--cc=dor@redhat.com \
--cc=markmc@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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).