From: Cornelia Huck <cohuck@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtio@lists.oasis-open.org, virtio-dev@lists.oasis-open.org,
Halil Pasic <pasic@linux.vnet.ibm.com>,
Tiwei Bie <tiwei.bie@intel.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Dhanoa, Kully" <kully.dhanoa@intel.com>
Subject: [virtio] Re: [PATCH v8 14/16] VIRTIO_F_NOTIFICATION_DATA: extra data to devices
Date: Fri, 16 Feb 2018 18:00:04 +0100 [thread overview]
Message-ID: <20180216180004.1c466a6e.cohuck@redhat.com> (raw)
In-Reply-To: <20180216092622-mutt-send-email-mst@kernel.org>
On Fri, 16 Feb 2018 09:26:22 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:
> Motivation for the new feature is included in the text.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> content.tex | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 130 insertions(+), 6 deletions(-)
>
> diff --git a/content.tex b/content.tex
> index c57a918..ca6d2d9 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -283,9 +283,76 @@ Packed Virtqueues}).
> Every driver and device supports either the Packed or the Split
> Virtqueue format, or both.
>
> +\subsection{Driver notifications} \label{sec:Virtqueues / Driver notifications}
> +Driver is sometimes required to notify the device after
> +making changes to the virtqueue.
> +
> +When VIRTIO_F_NOTIFICATION_DATA has not been negotiated,
> +this notification involves sending the
> +virtqueue number to the device (depending on the transport).
> +
> +However, some devices benefit from ability to find out the number of
> +available descriptors in the ring, and whether to send
> +interrupts to drivers without accessing virtqueue in memory:
> +for efficiency or as a debugging aid.
> +
> +To help with these optimizations, when VIRTIO_F_NOTIFICATION_DATA
> +has been negotiated, driver notifications to the device include
> +the following information:
> +
> +\begin{itemize}
> +\item VQ number
> +\item Offset
> + Within the ring where the next available ring entry
> + will be written.
> + Without VIRTIO_F_RING_PACKED this refers to the
> + 15 least significant bits of the available index.
> + With VIRTIO_F_RING_PACKED this refers to the offset
> + (in units of descritor entries)
> + within the descriptor ring where the next available
> + descriptor will be written.
> +\item Wrap Counter
> + With VIRTIO_F_RING_PACKED this is the wrap counter
> + referring to the next available descriptor.
> + Without VIRTIO_F_RING_PACKED this is the most significant bit
> + of the available index.
> +\end{itemize}
This looks a bit odd in the resulting pdf...
> +
> +Note that driver can trigger multiple notifications even without
> +making any more changes to the ring. These would then have
> +identical \field{Offset} and \field{Wrap Counter} values.
> +
> \input{split-ring.tex}
>
> \input{packed-ring.tex}
> +
> +\subsubsection{Driver notifications}
> +
> +\label{sec:Packed Virtqueues / Driver notifications}
> +Whenever not suppressed by Device Event Suppression,
> +driver is required to notify the device after
> +making changes to the virtqueue.
> +
> +Some devices benefit from ability to find out the number of
> +available descriptors in the ring, and whether to send
> +interrupts to drivers without accessing virtqueue in memory:
> +for efficiency or as a debugging aid.
> +
> +To help with these optimizations, driver notifications
> +to the device include the following information:
> +
> +\begin{itemize}
> +\item VQ number
> +\item Offset (in units of descriptor size) within the ring
> + where the next available descriptor will be written
> +\item Wrap Counter referring to the next available
> + descriptor
> +\end{itemize}
> +
> +Note that driver can trigger multiple notifications even without
> +making any more changes to the ring. These would then have
> +identical \field{Offset} and \field{Wrap Counter} values.
So, this in effect makes NOTIFICATION_DATA mandatory for the packed
ring... or is this just a leftover hunk?
(...)
> @@ -2340,12 +2449,23 @@ GPR & Input Value & Output Value \\
> \hline
> 2 & Subchannel ID & Host Cookie \\
> \hline
> - 3 & Virtqueue number & \\
> + 3 & Notification data & \\
> \hline
> 4 & Host Cookie & \\
> \hline
> \end{tabular}
>
> +When VIRTIO_F_NOTIFICATION_DATA has not been negotiated,
> +the \field{Notification data} includes the Virtqueue number.
> +
> +When VIRTIO_F_NOTIFICATION_DATA has been negotiated,
> +the \field{Notification data} is calculated as follows:
> +
> +\begin{lstlisting}
> +u32 notification_data = vqn | (next_off << 16) | (next_wrap << 31);
> +\end{lstlisting}
It would be good to add a reference to the part where the components of
the notification data are defined.
Otherwise, I think this looks fine (did not really look at the details
for pci or mmio).
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
next prev parent reply other threads:[~2018-02-16 17:00 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1518765602-8739-1-git-send-email-mst@redhat.com>
2018-02-16 7:21 ` [PATCH v8 01/16] content: move 1.0 queue format out to a separate section Michael S. Tsirkin
2018-02-16 7:21 ` [PATCH v8 02/16] content: move ring text out to a separate file Michael S. Tsirkin
2018-02-16 7:21 ` [PATCH v8 03/16] content: move virtqueue operation description Michael S. Tsirkin
2018-02-16 7:22 ` [PATCH v8 04/16] content: replace mentions of len with used length Michael S. Tsirkin
2018-02-16 16:35 ` [virtio] " Cornelia Huck
2018-02-16 7:22 ` [PATCH v8 05/16] content: generalize transport ring part naming Michael S. Tsirkin
2018-02-16 7:24 ` [PATCH v8 08/16] packed virtqueues: more efficient virtqueue layout Michael S. Tsirkin
2018-02-16 17:01 ` [virtio] " Cornelia Huck
2018-02-24 5:17 ` [virtio-dev] " Tiwei Bie
2018-02-25 18:49 ` [virtio] " Michael S. Tsirkin
2018-02-26 10:51 ` [virtio-dev] " Tiwei Bie
2018-02-26 20:38 ` [virtio] " Michael S. Tsirkin
2018-02-27 1:49 ` Tiwei Bie
2018-02-27 20:17 ` [virtio] " Michael S. Tsirkin
2018-02-28 9:19 ` Tiwei Bie
2018-02-28 15:20 ` [virtio] " Michael S. Tsirkin
2018-02-28 16:09 ` Cornelia Huck
2018-02-28 20:35 ` Michael S. Tsirkin
2018-02-26 17:19 ` [virtio] " Halil Pasic
2018-02-26 21:05 ` Michael S. Tsirkin
2018-02-27 10:23 ` [virtio-dev] " Jens Freimann
2018-02-27 11:29 ` [virtio] " Halil Pasic
2018-02-28 13:42 ` Jens Freimann
2018-02-28 13:59 ` [virtio] " Halil Pasic
2018-02-28 15:40 ` Michael S. Tsirkin
2018-02-28 16:29 ` Halil Pasic
2018-02-28 22:03 ` Michael S. Tsirkin
2018-02-28 22:01 ` Michael S. Tsirkin
2018-02-27 11:53 ` [virtio] " Halil Pasic
2018-02-27 14:11 ` Michael S. Tsirkin
2018-02-27 17:03 ` Halil Pasic
2018-02-28 13:25 ` [virtio-dev] " Jens Freimann
2018-02-28 22:10 ` [virtio] " Michael S. Tsirkin
2018-02-16 7:24 ` [PATCH v8 09/16] content: in-order buffer use Michael S. Tsirkin
2018-02-16 7:25 ` [PATCH v8 10/16] packed-ring: add in order support Michael S. Tsirkin
2018-02-16 7:25 ` [PATCH v8 11/16] split-ring: in order feature Michael S. Tsirkin
2018-02-16 7:25 ` [PATCH v8 12/16] makediff: update to show diff from master Michael S. Tsirkin
2018-02-16 16:45 ` [virtio] " Cornelia Huck
2018-02-16 7:26 ` [PATCH v8 13/16] REVISION: set to 1.1 wd07 Michael S. Tsirkin
2018-02-16 7:26 ` [PATCH v8 14/16] VIRTIO_F_NOTIFICATION_DATA: extra data to devices Michael S. Tsirkin
2018-02-16 17:00 ` Cornelia Huck [this message]
2018-02-16 7:26 ` [PATCH v8 15/16] conformance: link the new conformance clause Michael S. Tsirkin
2018-02-16 16:46 ` [virtio] " Cornelia Huck
2018-02-16 7:27 ` [PATCH v8 16/16] REVISION: set for packed-wd07.pdf Michael S. Tsirkin
2018-02-16 16:47 ` [virtio] " Cornelia Huck
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=20180216180004.1c466a6e.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=kully.dhanoa@intel.com \
--cc=mst@redhat.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtio@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