From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: SRS0=KMw5=FK=redhat.com=mst@kernel.org Date: Fri, 16 Feb 2018 09:24:41 +0200 From: "Michael S. Tsirkin" Subject: [PATCH v8 09/16] content: in-order buffer use Message-ID: <20180216092441-mutt-send-email-mst@kernel.org> References: <1518765602-8739-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518765602-8739-1-git-send-email-mst@redhat.com> To: virtio@lists.oasis-open.org, virtio-dev@lists.oasis-open.org Cc: Cornelia Huck , Halil Pasic , Tiwei Bie , Stefan Hajnoczi , "Dhanoa, Kully" List-ID: Using descriptors in-order is sometimes beneficial. Add an option for that - per-format detail allowing more optimizations will be added by follow-up patches. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Reviewed-by: Stefan Hajnoczi --- content.tex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/content.tex b/content.tex index 73f40b7..c57a918 100644 --- a/content.tex +++ b/content.tex @@ -245,6 +245,15 @@ a device event - i.e. send an interrupt to the driver. Device reports the number of bytes it has written to memory for each buffer it uses. This is referred to as ``used length''. +Device is not generally required to use buffers in +the same order in which they have been made available +by the driver. + +Some devices always use descriptors in the same order in which +they have been made available. These devices can offer the +VIRTIO_F_IN_ORDER feature. If negotiated, this knowledge +might allow optimizations or simplify driver and/or device code. + Each virtqueue can consist of up to 3 parts: \begin{itemize} \item Descriptor Area - used for describing buffers @@ -5248,6 +5257,9 @@ Descriptors} and \ref{sec:Packed Virtqueues / Indirect Flag: Scatter-Gather Supp \item[VIRTIO_F_RING_PACKED(34)] This feature indicates support for the packed virtqueue layout as described in \ref{sec:Basic Facilities of a Virtio Device / Packed Virtqueues}~\nameref{sec:Basic Facilities of a Virtio Device / Packed Virtqueues}. + \item[VIRTIO_F_IN_ORDER(35)] This feature indicates + that all buffers are used by the device in the same + order in which they have been made available. \end{description} \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits} @@ -5273,6 +5285,9 @@ translates bus addresses from the device into physical addresses in memory. A device MAY fail to operate further if VIRTIO_F_IOMMU_PLATFORM is not accepted. +If VIRTIO_F_IN_ORDER has been negotiated, a device MUST use +buffers in the same order in which they have been available. + \section{Legacy Interface: Reserved Feature Bits}\label{sec:Reserved Feature Bits / Legacy Interface: Reserved Feature Bits} Transitional devices MAY offer the following: -- MST