From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vitaly Mireyno <vmireyno@marvell.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
"virtio-comment@lists.oasis-open.org"
<virtio-comment@lists.oasis-open.org>,
Jason Wang <jasowang@redhat.com>
Subject: Re: [virtio-comment] [PATCH] virtio-net: Add support for the flexible driver notification
Date: Mon, 27 Jan 2020 10:34:24 -0500 [thread overview]
Message-ID: <20200127103246-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <BN6PR1801MB206783A6B3CB70E63FEFF837C50B0@BN6PR1801MB2067.namprd18.prod.outlook.com>
On Mon, Jan 27, 2020 at 12:49:48PM +0000, Vitaly Mireyno wrote:
>
> >-----Original Message-----
> >From: Stefan Hajnoczi <stefanha@redhat.com>
> >Sent: Monday, 27 January, 2020 11:50
> >To: Vitaly Mireyno <vmireyno@marvell.com>
> >Cc: virtio-comment@lists.oasis-open.org; Michael S. Tsirkin
> ><mst@redhat.com>; Jason Wang <jasowang@redhat.com>
> >Subject: [EXT] Re: [virtio-comment] [PATCH] virtio-net: Add support for
> >the flexible driver notification
> >
> >On Sun, Jan 26, 2020 at 12:10:28PM +0000, Vitaly Mireyno wrote:
> >> Currently, the driver notification (available buffer notification)
> >> has a fixed
> >structure.
> >> If VIRTIO_F_NOTIFICATION_DATA has been negotiated, it includes: vqn,
> >next_off and next_wrap.
> >> If notify_off_multiplier > 0, the VQ number can be derived by the
> >> device
> >from the Queue Notify address, so vqn may be redundant.
> >>
> >> Some devices benefit from receiving an additional data with driver
> >notifications (because of the specific hardware implementation). This
> >data can optionally replace the vqn field in the driver notification structure.
> >> In its simplest form, it would be sufficient for this data to be a
> >> per-device
> >constant value.
> >>
> >>
> >> Signed-off-by: Vitaly Mireyno <vmireyno@marvell.com>
> >> ---
> >> content.tex | 24 ++++++++++++++++++++++++
> >> 1 file changed, 24 insertions(+)
> >
> >Hi Vitaly,
> >Can you give a concrete example of how devices can use this feature?
> >
> >The reason I'm a little unsure is that the PCI capability only provides
> >a single notify_data value per device. That same value is then passed
> >back to the device in the notify write.
> >
> >If there is just a single constant value per device, why is it
> >necessary to involve the driver at all? Doesn't the device already
> >know its own magic value and it doesn't really need the driver to pass the value back to it?
> >
> >Stefan
> >
>
> This will help HW devices that share the same memory space between virtqueue notifications and other types of notifications. The virtio driver will always use the value that will tell the HW that it's a virtqueue notification.
> Of course, the feature can be extended, such that there will be a value configurable per virtqueue (which is a generalization of the vqn field). I just didn't want to complicate it further, without a real-life justification.
I would like to see a bit more detail about these other types of notifications then.
>
> >> diff --git a/content.tex b/content.tex index 06bb4ca..265dc12 100644
> >> --- a/content.tex
> >> +++ b/content.tex
> >> @@ -965,6 +965,9 @@ \subsubsection{Notification structure
> >> layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap {
> >> struct virtio_pci_cap cap;
> >> le32 notify_off_multiplier; /* Multiplier for
> >> queue_notify_off. */
> >> + le16 notify_data; /* The data to be placed in the vqn field */
> >> + u8 notify_data_valid;
> >> + u8 padding; /* Pad to a dword */
> >> };
> >> \end{lstlisting}
> >>
> >> @@ -984,6 +987,9 @@ \subsubsection{Notification structure
> >> layout}\label{sec:Virtio Transport Options the same Queue Notify
> >> address
> >for all queues.
> >> \end{note}
> >>
> >> +If \field{notify_data_valid} != 0, the driver will set the
> >> +\field{vqn} field in the available buffer notification structure to
> >> +the
> >\field{notify_data} value.
> >> +
> >> \devicenormative{\paragraph}{Notification capability}{Virtio
> >> Transport Options / Virtio Over PCI Bus / PCI Device Layout /
> >> Notification
> >capability} The device MUST present at least one notification capability.
> >>
> >> @@ -1020,6 +1026,12 @@ \subsubsection{Notification structure
> >> layout}\label{sec:Virtio Transport Options cap.length >=
> >> queue_notify_off * notify_off_multiplier + 4 \end{lstlisting}
> >>
> >> +The device MAY set \field{notify_data_valid} to any non-zero value,
> >> +to request the driver to set the \field{vqn} to the \field{notify_data} value.
> >> +If the device sets \field{notify_data_valid} to a non-zero value, it
> >> +MUST set \field{notify_data} to a valid value.
> >> +For a normal operation, the device MUST set
> >> +\field{notify_data_valid} to
> >zero.
> >> +
> >> \subsubsection{ISR status capability}\label{sec:Virtio Transport
> >> Options / Virtio Over PCI Bus / PCI Device Layout / ISR status
> >> capability}
> >>
> >> The VIRTIO_PCI_CAP_ISR_CFG capability @@ -1519,6 +1531,18 @@
> >> \subsubsection{Available Buffer Notifications}\label{sec:Virtio
> >> Transport Option See \ref{sec:Virtio Transport Options / Virtio Over
> >> PCI Bus / PCI Device Layout / Notification capability} for how to
> >> calculate the
> >Queue Notify address.
> >>
> >> +\drivernormative{\paragraph}{Available Buffer Notifications}{Virtio
> >> +Transport Options / Virtio Over PCI Bus / PCI-specific
> >> +Initialization And Device Operation / Available Buffer
> >> +Notifications} If VIRTIO_F_NOTIFICATION_DATA has been negotiated,
> >> +and if
> >\field{notify_data_valid} != 0, the driver MUST set the \field{vqn}
> >field of the available buffer notification structure to the \field{notify_data} value.
> >> +
> >> +\begin{note}
> >> +If \field{notify_off_multiplier} > 0, the virtqueue number can
> >> +potentially be derived by the device from the Queue Notify address,
> >> +so \field{vqn} may be redundant. Some devices benefit from receiving
> >> +the additional data with driver notifications (because of the
> >> +specific
> >hardware implementation).
> >> +\end{note}
> >> +
> >> \subsubsection{Used Buffer Notifications}\label{sec:Virtio Transport
> >> Options / Virtio Over PCI Bus / PCI-specific Initialization And
> >> Device Operation / Used Buffer Notifications}
> >>
> >> If a used buffer notification is necessary for a virtqueue, the
> >> device would
> >typically act as follows:
> >> --
> >>
> >> This publicly archived list offers a means to provide input to the
> >> OASIS Virtual I/O Device (VIRTIO) TC.
> >>
> >> In order to verify user consent to the Feedback License terms and to
> >> minimize spam in the list archive, subscription is required before
> >> posting.
> >>
> >> Subscribe: virtio-comment-subscribe@lists.oasis-open.org
> >> Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
> >> List help: virtio-comment-help@lists.oasis-open.org
> >> List archive: https://lists.oasis-open.org/archives/virtio-comment/
> >> Feedback License:
> >> https://www.oasis-open.org/who/ipr/feedback_license.pdf
> >> List Guidelines:
> >> https://www.oasis-open.org/policies-guidelines/mailing-lists
> >> Committee: https://www.oasis-open.org/committees/virtio/
> >> Join OASIS: https://www.oasis-open.org/join/
> >>
This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.
Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
next prev parent reply other threads:[~2020-01-27 15:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-27 12:49 [virtio-comment] [PATCH] virtio-net: Add support for the flexible driver notification Vitaly Mireyno
2020-01-27 15:34 ` Michael S. Tsirkin [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-02-03 11:53 Vitaly Mireyno
2020-01-30 16:56 Vitaly Mireyno
2020-02-03 9:52 ` Michael S. Tsirkin
2020-01-30 15:53 Vitaly Mireyno
2020-01-30 16:12 ` Michael S. Tsirkin
2020-01-30 12:49 Vitaly Mireyno
2020-01-30 15:07 ` Michael S. Tsirkin
2020-01-28 14:33 Vitaly Mireyno
2020-01-29 9:58 ` Michael S. Tsirkin
2020-01-27 17:00 Vitaly Mireyno
2020-01-27 18:47 ` Michael S. Tsirkin
2020-01-26 12:10 Vitaly Mireyno
2020-01-27 9:49 ` Stefan Hajnoczi
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=20200127103246-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=vmireyno@marvell.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.