public inbox for virtio-dev@lists.linux.dev
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.ibm.com>
To: Parav Pandit <parav@nvidia.com>
Cc: <mst@redhat.com>, <virtio-dev@lists.oasis-open.org>,
	<cohuck@redhat.com>, <sgarzare@redhat.com>,
	<virtio-comment@lists.oasis-open.org>, <shahafs@nvidia.com>,
	Halil Pasic <pasic@linux.ibm.com>
Subject: [virtio-dev] Re: [virtio-comment] [PATCH v14 04/11] transport-pci: Avoid first vq index reference
Date: Mon, 24 Apr 2023 15:29:19 +0200	[thread overview]
Message-ID: <20230424152919.70254ffa.pasic@linux.ibm.com> (raw)
In-Reply-To: <20230419014639.919458-5-parav@nvidia.com>

On Wed, 19 Apr 2023 04:46:32 +0300
Parav Pandit <parav@nvidia.com> wrote:

> Drop reference to first virtqueue as it is already
> covered now by the generic section in first patch.
> 

TL;DR:

Acked-by: Halil Pasic <pasic@linux.ibm.com>

Rationale: 
---------
I agree, what a virtqueue index is should be described in a
single place instead all over the place. And further improvements can be done
on top of this series. 

Discussion:
-----------
Is it indeed covered now by the generic section in first patch?

In [1] you state the following: "There is nothing like a zero based
index. A VQ can be any u16 _number_ in range of 0 to 65534.
Number can also start from zero. So zero based index = zero based
number."

I don't really understand what do you mean by this, but I'm afraid
it is not consistent with my understanding. Can not be any number in
range of 0 to 65534.

Rather in general it depends on the device type, and on the device
how many queues it support. Let us call this number dev_vq_max. And
if dev_vq_max > N > 0 index is associated with a queue the N-1 index is
also associated with a queue.

Let me also note that the number of queues supported/provided by the
device is a matter of the device. For many devices the number of queues
is a constant given in the specification. A Network Device tells
its driver how may queues it supports via max_virtqueue_pairs,
Crypto Device via max_dataqueues, and Console Device via max_dataqueues.
The transports PCI also has num_queues which is documented as "The
device specifies the maximum number of virtqueues supported here." while
CCW and MMIO have no transport specific means to tell the driver about
the number of queues supported by the device. In any case, if the number
of queues provided by the device is N, each of those queues is uniquely
identified by exactly one index from the range [0..N-1]. Furthermore
the role a certain queue plays is determined by its index. E.g. for
the Console Device virtqueue identified by the index 3 is the "control
receiveq".

[1]
https://lore.kernel.org/virtio-comment/d62d2090-de0d-0ea6-5c85-ecf19ae828c7@nvidia.com/

[..]
>  
>  \begin{enumerate}
> -\item Write the virtqueue index (first queue is 0) to \field{queue_select}.
> +\item Write the virtqueue index to \field{queue_select}.
>  
>  \item Read the virtqueue size from \field{queue_size}. This controls how big the virtqueue is
>    (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues}~\nameref{sec:Basic Facilities of a Virtio Device / Virtqueues}). If this field is 0, the virtqueue does not exist.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  reply	other threads:[~2023-04-24 13:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  1:46 [virtio-dev] [PATCH v14 00/11] Rename queue number to queue index Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 01/11] content: Add vq index text Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 02/11] content.tex Replace virtqueue number with index Parav Pandit
2023-04-19 16:08   ` [virtio-dev] " Halil Pasic
2023-04-19 16:11     ` [virtio-dev] " Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 03/11] content: Rename confusing queue_notify_data and vqn names Parav Pandit
2023-04-21 22:37   ` [virtio-dev] " Halil Pasic
2023-04-24 14:00     ` Michael S. Tsirkin
2023-04-24 16:11     ` [virtio-dev] " Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 04/11] transport-pci: Avoid first vq index reference Parav Pandit
2023-04-24 13:29   ` Halil Pasic [this message]
2023-04-25  4:10     ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-25 13:02       ` Halil Pasic
2023-04-25 13:15         ` Michael S. Tsirkin
2023-04-25 16:20           ` Halil Pasic
2023-04-25 21:11             ` Michael S. Tsirkin
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 05/11] transport-mmio: Rename QueueNum register Parav Pandit
2023-04-24 12:53   ` Halil Pasic
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 06/11] transport-mmio: Avoid referring to zero based index Parav Pandit
2023-04-25 10:59   ` [virtio-dev] Re: [virtio-comment] " Halil Pasic
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 07/11] transport-ccw: Rename queue depth/size to other transports Parav Pandit
2023-04-24 12:58   ` Halil Pasic
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 08/11] transport-ccw: Refer to the vq by its index Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 09/11] virtio-net: Avoid duplicate receive queue example Parav Pandit
2023-04-24 13:10   ` Halil Pasic
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 10/11] virtio-net: Describe RSS using rss rq id Parav Pandit
2023-04-24 13:22   ` [virtio-dev] " Halil Pasic
2023-04-24 13:58     ` Michael S. Tsirkin
2023-04-24 15:30       ` [virtio-dev] " Parav Pandit
2023-04-24 15:54         ` [virtio-dev] " Michael S. Tsirkin
2023-04-24 16:02           ` [virtio-dev] " Parav Pandit
2023-04-19  1:46 ` [virtio-dev] [PATCH v14 11/11] virtio-net: Update vqn to vq_index for cvq cmds Parav Pandit
2023-04-24 13:26   ` Halil Pasic

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=20230424152919.70254ffa.pasic@linux.ibm.com \
    --to=pasic@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=sgarzare@redhat.com \
    --cc=shahafs@nvidia.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