Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, jasowang@redhat.com,
	virtio-comment@lists.oasis-open.org,
	virtio-dev@lists.oasis-open.org
Cc: stefanha@redhat.com, mgurtovoy@nvidia.com, cohuck@redhat.com,
	eperezma@redhat.com, oren@nvidia.com, shahafs@nvidia.com,
	parav@nvidia.com, bodong@nvidia.com, amikheev@nvidia.com,
	pasic@linux.ibm.com, dgilbert@redhat.com
Subject: [PATCH] virtio-pci: implement VIRTIO_F_RING_STATE
Date: Wed,  7 Jul 2021 12:34:41 +0800	[thread overview]
Message-ID: <20210707043441.42361-1-jasowang@redhat.com> (raw)

This patch is a follow up for the virtqueue state synchronization
series to implement VIRTIO_F_RING_STATE via a dedicated capability for
PCI transport.

With the help of the STOP status bit, the virtqueue state
synchronization for PCI should be self contained.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 content.tex | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/content.tex b/content.tex
index 284ead0..f1848f7 100644
--- a/content.tex
+++ b/content.tex
@@ -878,6 +878,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option
 #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
 /* Vendor-specific data */
 #define VIRTIO_PCI_CAP_VENDOR_CFG        9
+/* General Virtqueue State */
+#define VIRTIO_PCI_CAP_RING_STATE        10
 \end{lstlisting}
 
         Any other value is reserved for future use.
@@ -1434,6 +1436,36 @@ \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O
 specified by some other Virtio Structure PCI Capability
 of type other than \field{VIRTIO_PCI_CAP_PCI_CFG}.
 
+\subsubsection{General Virtqueue State}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / General Virtqueue State}
+
+The VITIO_PCI_CAP_RING_STATE capability is for the driver to configure
+the virtqueue state(see \ref{sec:Virtqueues / Virtqueue State}):
+
+The capability is immediately followed by an additional field like so:
+
+\begin{lstlisting}
+struct virtio_pci_cfg_cap {
+        struct virtio_pci_cap cap;
+        le16 queue_select; /* read-write */
+        le16 avail_state;  /* read-write */
+        le16 used_state;   /* read-write */
+};
+\end{lstlisting}
+
+\begin{description}
+\item[\field{queue_select}]
+        Queue Select. The driver selects which virtqueue the following
+        fields refer to.
+\item[\field{avail_state}]
+        The driver writes and reads available state here.
+\item[\field{used_state}]
+        The driver writes and reads used state here.
+\end{description}
+
+\devicenormative{\paragraph}{General Virtqueue State}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / General Virtqueue State}
+
+The device MUST present at least one VIRTIO_PCI_CAP_RING_STATE capability if VITIO_F_RING_STATE is negotiated.
+
 \subsubsection{Legacy Interfaces: A Note on PCI Device Layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: A Note on PCI Device Layout}
 
 Transitional devices MUST present part of configuration
-- 
2.25.1


             reply	other threads:[~2021-07-07  4:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  4:34 Jason Wang [this message]
2021-07-09 11:06 ` [virtio-comment] Re: [PATCH] virtio-pci: implement VIRTIO_F_RING_STATE Cornelia Huck
2021-07-12  3:11   ` Jason Wang
2021-07-12 10:29 ` Stefan Hajnoczi
2021-07-13  3:39   ` Jason Wang

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=20210707043441.42361-1-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=amikheev@nvidia.com \
    --cc=bodong@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=mst@redhat.com \
    --cc=oren@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=pasic@linux.ibm.com \
    --cc=shahafs@nvidia.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@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