[virtio-dev] Re: [PATCH v16 06/11] transport-mmio: Avoid referring to zero based index

David Edmondson
2023-05-04T14:29:52Z

Parav Pandit <parav@nvidia.com> writes:

> VQ range is already described in the first patch in basic virtqueue
> section. Hence remove the duplicate reference to it.
>
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/163
> Acked-by: Halil Pasic <pasic@linux.ibm.com>
> Signed-off-by: Parav Pandit <parav@nvidia.com>
>

Reviewed-by: David Edmondson <david.edmondson@oracle.com>

> ---
> changelog:
> v12->v13:
> - corrected number to index
> v11->v12:
> - remove changes related to 'vq number'
> v8->v9:
> - added 'by' at two places
> - replaced 'queue number' with 'vq number'
>
> v6->v7:
> - remove text around first vq as it is already covered in the basic
> virtqueues facility section
> ---
> transport-mmio.tex | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/transport-mmio.tex b/transport-mmio.tex
> index 164e640..2d24b4c 100644
> --- a/transport-mmio.tex
> +++ b/transport-mmio.tex
> @@ -113,8 +113,7 @@ \subsection{MMIO Device Register Layout}\label{sec:Virtio Transport Options / Vi
> following operations on \field{QueueSizeMax},
> \field{QueueSize}, \field{QueueReady},
> \field{QueueDescLow}, \field{QueueDescHigh}, \field{QueueDriverlLow}, \field{QueueDriverHigh},
> - \field{QueueDeviceLow}, \field{QueueDeviceHigh} and \field{QueueReset} apply to. The index
> - number of the first queue is zero (0x0).
> + \field{QueueDeviceLow}, \field{QueueDeviceHigh} and \field{QueueReset} apply to.
> }
> \hline
> \mmioreg{QueueSizeMax}{Maximum virtual queue size}{0x034}{R}{%
> @@ -363,8 +362,7 @@ \subsubsection{Virtqueue Configuration}\label{sec:Virtio Transport Options / Vir
> The driver will typically initialize the virtual queue in the following way:
>
> \begin{enumerate}
> -\item Select the queue writing its index (first queue is 0) to
> - \field{QueueSel}.
> +\item Select the queue by writing its index to \field{QueueSel}.
>
> \item Check if the queue is not already in use: read \field{QueueReady},
> and expect a returned value of zero (0x0).
> @@ -474,9 +472,7 @@ \subsection{Legacy interface}\label{sec:Virtio Transport Options / Virtio Over M
> Writing to this register selects the virtual queue that the
> following operations on the \field{QueueSizeMax},
> \field{QueueSize}, \field{QueueAlign}
> - and \field{QueuePFN} registers apply to. The index
> - number of the first queue is zero (0x0).
> -.
> + and \field{QueuePFN} registers apply to.
> }
> \hline
> \mmioreg{QueueSizeMax}{Maximum virtual queue size}{0x034}{R}{%
> @@ -550,8 +546,7 @@ \subsection{Legacy interface}\label{sec:Virtio Transport Options / Virtio Over M
>
> The virtual queue is configured as follows:
> \begin{enumerate}
> -\item Select the queue writing its index (first queue is 0) to
> - \field{QueueSel}.
> +\item Select the queue by writing its index to \field{QueueSel}.
>
> \item Check if the queue is not already in use: read \field{QueuePFN},
> expecting a returned value of zero (0x0).
> --
> 2.26.2
--
Up eighty flights of stairs to a basement flat.