From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Liang, Cunming" <cunming.liang@intel.com>
Cc: "virtio-dev@lists.oasis-open.org"
<virtio-dev@lists.oasis-open.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [virtio-dev] packed ring layout proposal v3
Date: Tue, 26 Sep 2017 01:24:32 +0300 [thread overview]
Message-ID: <20170926011826-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <D0158A423229094DA7ABF71CF2FA0DA34E1A46A6@SHSMSX152.ccr.corp.intel.com>
On Wed, Sep 20, 2017 at 09:11:57AM +0000, Liang, Cunming wrote:
> Hi Michael,
>
> > -----Original Message-----
> > From: virtio-dev@lists.oasis-open.org [mailto:virtio-dev@lists.oasis-open.org]
> > On Behalf Of Michael S. Tsirkin
> > Sent: Sunday, September 10, 2017 1:06 PM
> > To: virtio-dev@lists.oasis-open.org
> > Cc: virtualization@lists.linux-foundation.org
> > Subject: [virtio-dev] packed ring layout proposal v3
> >
> [...]
> > * Descriptor ring:
> >
> > Driver writes descriptors with unique index values and DESC_DRIVER set in
> > flags.
> > Descriptors are written in a ring order: from start to end of ring, wrapping
> > around to the beginning.
> > Device writes used descriptors with correct len, index, and DESC_HW clear.
> > Again descriptors are written in ring order. This might not be the same order
> > of driver descriptors, and not all descriptors have to be written out.
> >
> > Driver and device are expected to maintain (internally) a wrap-around bit,
> > starting at 0 and changing value each time they start writing out descriptors
> > at the beginning of the ring. This bit is passed as DESC_WRAP bit in the flags
> > field.
>
> One simple question there, trying to understand the usage of DESC_WRAP flag.
>
> DESC_WRAP bit is a new flag since v2. It's used to address 'non power-of-2 ring sizes' mentioned in v2?
>
> Being confused by the statement of wrap-around bit here, it's an internal wrap-around counter represented by single bit (0/1)?
> DESC_WRAP can appear on any descriptor entry in the ring, why it highlights changing value at the beginning of the ring?
No, this is necessary if not all descriptors are overwritten by device
after they are used.
Each time driver overwrites a descriptor, the value in DESC_WRAP changes
which makes it possible for device to detect that there's a new
descriptor.
> >
> > Flags are always set/cleared last.
> >
> > Note that driver can write descriptors out in any order, but device will not
> > execute descriptor X+1 until descriptor X has been read as valid.
> >
> > Driver operation:
> >
> [...]
> >
> > DESC_WRAP - device uses this field to detect descriptor change by driver.
>
> Device uses this field to detect change of wrap-around boundary by driver?
>
> [...]
> >
> > Device operation (using descriptors):
> >
> [...]
> >
> > DESC_WRAP - driver uses this field to detect descriptor change by device.
>
> Driver uses this field to detect change of wrap-around boundary by device?
>
> By using this, driver doesn't need to maintain any internal wrap-around count, but being aware of wrap-around by DESC_WRAP flag.
>
>
> Thanks,
> Steve
So v2 simply said descriptor has a single bit: driver writes 1 there,
device writes 0.
This requires device to overwrite each descriptor and people asked
for a way to communicate where some descriptors are not overwritten.
This new bit helps device distinguish new and old descriptors written by driver.
> >
> [...]
> >
> > ---
> >
> > Note: should this proposal be accepted and approved, one or more
> > claims disclosed to the TC admin and listed on the Virtio TC
> > IPR page https://www.oasis-open.org/committees/virtio/ipr.php
> > might become Essential Claims.
> > Note: the page above is unfortunately out of date and out of
> > my hands. I'm in the process of updating ipr disclosures
> > in github instead. Will make sure all is in place before
> > this proposal is put to vote. As usual this TC operates under the
> > Non-Assertion Mode of the OASIS IPR Policy, which protects
> > anyone implementing the virtio spec.
> >
> > --
> > MST
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2017-09-25 22:24 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-10 5:06 [virtio-dev] packed ring layout proposal v3 Michael S. Tsirkin
[not found] ` <240c623b-2d8f-28d9-d349-d01e2c24b93a@redhat.com>
[not found] ` <20170208214435-mutt-send-email-mst@kernel.org>
[not found] ` <cc075b18-0913-ef89-96a8-a29869abd73e@redhat.com>
[not found] ` <20170209171105.075a9d9c.cornelia.huck@de.ibm.com>
[not found] ` <20170222181333-mutt-send-email-mst@kernel.org>
[not found] ` <20170307165353.00ff80d9.cornelia.huck@de.ibm.com>
[not found] ` <20170307223057-mutt-send-email-mst@kernel.org>
2017-07-10 16:27 ` [virtio-dev] packed ring layout proposal v2 Amnon Ilan
2017-07-16 6:00 ` Lior Narkis
2017-07-18 16:23 ` Michael S. Tsirkin
2017-07-19 7:41 ` Lior Narkis
2017-07-20 13:06 ` Michael S. Tsirkin
2017-09-11 7:47 ` [virtio-dev] Re: packed ring layout proposal v3 Jason Wang
2017-09-12 16:23 ` Willem de Bruijn
2017-09-13 1:26 ` Jason Wang
2017-09-12 16:20 ` [virtio-dev] " Willem de Bruijn
2017-09-20 9:11 ` Liang, Cunming
2017-09-25 22:24 ` Michael S. Tsirkin [this message]
2017-09-26 23:38 ` Steven Luong (sluong)
2017-09-27 23:49 ` Michael S. Tsirkin
2017-09-28 9:44 ` Liang, Cunming
2017-10-01 4:08 ` Michael S. Tsirkin
[not found] ` <20171004123901.oomueufqg52uhas4@localhost.localdomain>
2017-10-04 12:58 ` Michael S. Tsirkin
2017-10-10 9:56 ` Liang, Cunming
2017-09-28 21:13 ` Michael S. Tsirkin
2017-09-21 13:36 ` Liang, Cunming
2017-09-28 21:27 ` Michael S. Tsirkin
2017-10-08 6:16 ` [virtio-dev] " Ilya Lesokhin
2017-10-25 16:20 ` [virtio-dev] " Michael S. Tsirkin
2017-10-29 9:05 ` [virtio-dev] " Ilya Lesokhin
2017-10-29 14:21 ` [virtio-dev] " Michael S. Tsirkin
2017-10-29 14:34 ` [virtio-dev] " Ilya Lesokhin
2017-10-30 2:08 ` [virtio-dev] " Michael S. Tsirkin
2017-10-30 6:30 ` [virtio-dev] " Ilya Lesokhin
2017-10-30 16:30 ` [virtio-dev] " Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2017-10-20 9:50 [virtio-dev] " Lars Ganrot
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=20170926011826-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=cunming.liang@intel.com \
--cc=virtio-dev@lists.oasis-open.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