From: "Michael S. Tsirkin" <mst@redhat.com>
To: virtio@lists.oasis-open.org, virtio-dev@lists.oasis-open.org
Cc: Cornelia Huck <cohuck@redhat.com>,
Halil Pasic <pasic@linux.vnet.ibm.com>,
Tiwei Bie <tiwei.bie@intel.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Dhanoa, Kully" <kully.dhanoa@intel.com>
Subject: [virtio] [PATCH v9 13/16] split-ring: in order feature
Date: Thu, 1 Mar 2018 01:31:36 +0200 [thread overview]
Message-ID: <1519860484-7936-14-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1519860484-7936-1-git-send-email-mst@redhat.com>
For a split ring, require that drivers use descriptors in order too.
This allows devices to skip reading the available ring.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
split-ring.tex | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/split-ring.tex b/split-ring.tex
index 87ecee2..df278fe 100644
--- a/split-ring.tex
+++ b/split-ring.tex
@@ -203,6 +203,10 @@ struct virtq_desc {
The number of descriptors in the table is defined by the queue size
for this virtqueue: this is the maximum possible descriptor chain length.
+If VIRTIO_F_IN_ORDER has been negotiated, driver uses
+descriptors in ring order: starting from offset 0 in the table,
+and wrapping around at the end of the table.
+
\begin{note}
The legacy \hyperref[intro:Virtio PCI Draft]{[Virtio PCI Draft]}
referred to this structure as vring_desc, and the constants as
@@ -218,6 +222,12 @@ purposes).
Drivers MUST NOT add a descriptor chain over than $2^{32}$ bytes long in total;
this implies that loops in the descriptor chain are forbidden!
+If VIRTIO_F_IN_ORDER has been negotiated, and when making a
+descriptor with VRING_DESC_F_NEXT set in \field{flags} at offset
+$x$ in the table available to the device, driver MUST set
+\field{next} to $0$ for the last descriptor in the table
+(where $x = queue\_size - 1$) and to $x + 1$ for the rest of the descriptors.
+
\subsubsection{Indirect Descriptors}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
Some devices benefit by concurrently dispatching a large number
@@ -247,6 +257,10 @@ chained by \field{next}. An indirect descriptor without a valid \field{next}
A single indirect descriptor
table can include both device-readable and device-writable descriptors.
+If VIRTIO_F_IN_ORDER has been negotiated, indirect descriptors
+use sequential indices, in-order: index 0 followed by index 1
+followed by index 2, etc.
+
\drivernormative{\paragraph}{Indirect Descriptors}{Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
The driver MUST NOT set the VIRTQ_DESC_F_INDIRECT flag unless the
VIRTIO_F_INDIRECT_DESC feature was negotiated. The driver MUST NOT
@@ -259,6 +273,10 @@ the device.
A driver MUST NOT set both VIRTQ_DESC_F_INDIRECT and VIRTQ_DESC_F_NEXT
in \field{flags}.
+If VIRTIO_F_IN_ORDER has been negotiated, indirect descriptors
+MUST appear sequentially, with \field{next} taking the value
+of 1 for the 1st descriptor, 2 for the 2nd one, etc.
+
\devicenormative{\paragraph}{Indirect Descriptors}{Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
The device MUST ignore the write-only flag (\field{flags}\&VIRTQ_DESC_F_WRITE) in the descriptor that refers to an indirect table.
--
MST
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
next prev parent reply other threads:[~2018-02-28 23:31 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 23:31 [virtio] [PATCH v9 00/16] packed ring layout spec Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 01/16] introduction: document bitfield notation Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 02/16] content: move 1.0 queue format out to a separate section Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 03/16] content: move ring text out to a separate file Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 04/16] content: move virtqueue operation description Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 05/16] content: len -> used length, used ring -> vq Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 06/16] content: generalize transport ring part naming Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 07/16] content: generalize rest of text Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 08/16] split-ring: generalize text Michael S. Tsirkin
2018-03-07 11:00 ` [virtio] " Cornelia Huck
2018-03-09 22:56 ` Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 09/16] split-ring: typo: aligment Michael S. Tsirkin
2018-03-07 10:56 ` [virtio] " Cornelia Huck
2018-02-28 23:31 ` [virtio] [PATCH v9 11/16] content: in-order buffer use Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 10/16] packed virtqueues: more efficient virtqueue layout Michael S. Tsirkin
2018-03-07 13:47 ` [virtio] " Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 12/16] packed-ring: add in order support Michael S. Tsirkin
2018-02-28 23:31 ` Michael S. Tsirkin [this message]
2018-02-28 23:31 ` [virtio] [PATCH v9 14/16] VIRTIO_F_NOTIFICATION_DATA: extra data to devices Michael S. Tsirkin
2018-03-07 11:11 ` [virtio] " Cornelia Huck
2018-03-07 14:09 ` Michael S. Tsirkin
2018-03-07 14:49 ` Cornelia Huck
2018-03-07 15:10 ` Michael S. Tsirkin
2018-03-07 15:13 ` Cornelia Huck
2018-03-07 16:05 ` Halil Pasic
2018-03-07 16:14 ` Cornelia Huck
2018-03-07 19:53 ` Michael S. Tsirkin
2018-03-08 13:03 ` [virtio] Re: [virtio-dev] " Halil Pasic
2018-03-08 16:19 ` Michael S. Tsirkin
2018-03-09 8:16 ` Cornelia Huck
2018-03-09 12:25 ` Halil Pasic
2018-03-09 16:52 ` Michael S. Tsirkin
2018-03-07 19:27 ` Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH dont commit v9 16/16] REVISION: set to 1.1 packed wd09 Michael S. Tsirkin
2018-02-28 23:31 ` [virtio] [PATCH v9 15/16] makediff: update to show diff from master Michael S. Tsirkin
2018-03-09 17:06 ` [virtio] Re: [PATCH v9 00/16] packed ring layout spec Michael S. Tsirkin
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=1519860484-7936-14-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=cohuck@redhat.com \
--cc=kully.dhanoa@intel.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtio@lists.oasis-open.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