On Tue, Aug 15, 2023 at 03:29:04AM +0800, Zhu Lingshan wrote: > This patch adds two new le16 fields to common configruation structure > to support VIRTIO_F_QUEUE_STATE in PCI tranport layer. > > Signed-off-by: Jason Wang <[email protected]> > Signed-off-by: Zhu Lingshan <[email protected]> > --- > transport-pci.tex | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/transport-pci.tex b/transport-pci.tex > index a5c6719..d9bccb0 100644 > --- a/transport-pci.tex > +++ b/transport-pci.tex > @@ -321,6 +321,8 @@ \subsubsection{Common configuration structure > layout}\label{sec:Virtio Transport > le64 queue_device; /* read-write */ > le16 queue_notif_config_data; /* read-only for driver */ > le16 queue_reset; /* read-write */ > + le16 queue_avail_state; /* read-write */ > + le16 queue_used_state; /* read-write */ > > /* About the administration virtqueue. */ > le16 admin_queue_index; /* read-only for driver */
This is an incompatible change to the register layout. Please add new
registers at the end of struct virtio_pci_common_cfg so field offsets
don't change for existing drivers and devices.
> @@ -415,6 +417,16 @@ \subsubsection{Common configuration structure
> layout}\label{sec:Virtio Transport
> This field exists only if VIRTIO_F_RING_RESET has been
> negotiated. (see \ref{sec:Basic Facilities of a Virtio Device /
> Virtqueues / Virtqueue Reset}).
>
> +\item[\field{queue_avail_state}]
> + This field is vaild only if VIRTIO_F_QUEUE_STATE has been
"valid"
> + negotiated. The driver sets and gets the available state of
> + the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
> +
> +\item[\field{queue_used_state}]
> + This field is vaild only if VIRTIO_F_QUEUE_STATE has been
"valid"
> + negotiated. The driver sets and gets the used state of the
> + virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
> +
> \item[\field{admin_queue_index}]
> The device uses this to report the index of the first administration
> virtqueue.
> This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated.
> @@ -488,6 +500,9 @@ \subsubsection{Common configuration structure
> layout}\label{sec:Virtio Transport
> present either a value of 0 or a power of 2 in
> \field{queue_size}.
>
> +If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST ignore
> +any accesses against \field{queue_avail_state} and \field{queue_used_state}.
"accesses to"
> +
> If VIRTIO_F_ADMIN_VQ has been negotiated, the value
> \field{admin_queue_index} MUST be equal to, or bigger than
> \field{num_queues}; also, \field{admin_queue_num} MUST be
> --
> 2.35.3
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
signature.asc
Description: PGP signature
