virtio-comment.lists.oasis-open.org archive mirror
 help / color / mirror / Atom feed
From: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
To: virtualization@lists.linux-foundation.org
Cc: virtio-comment@lists.oasis-open.org,
	anton.yakovlev@opensynergy.com, stefanha@redhat.com,
	mst@redhat.com, jasowang@redhat.com, sgarzare@redhat.com,
	manos.pitsidianakis@linaro.org
Subject: [virtio-comment] virtio-sound: release control request clarification
Date: Tue, 17 Oct 2023 17:19:31 +0200	[thread overview]
Message-ID: <ZS6mA6/EsmvDVlTC@fedora> (raw)

Hello,

This email is to clarify the VirtIO specification regarding the RELEASE
control request. Section 5.14.6.6.5.1 [1] states the following device
requirements for the RELEASE control request: 
1. The device MUST complete all pending I/O messages for the specified
stream ID.
2. The device MUST NOT complete the control request while there are
pending I/O messages for the specified stream ID.

The 1) requirement does not indicate what "complete" means. Does it mean
that the pending I/O messages in the tx queue shall be outputted in the
host, i.e., consumed by the audio backend? Or, completion means simply
to put the requests in the used-ring without consuming them?

Regarding 2), I interpret it as "the device shall wait until all I/O
messages are proceeded to complete the RELEASE control request".

Currently, the kernel driver seems not expecting such a delay when the
RELEASE command is sent. If I understand correctly, the kernel driver
first sends the RELEASE command and waits a fixed amount of time until
the device can process it. Then, the driver waits a fixed amount of time
until all pending IO messages are completed. If the device follows the
specification and waits until all messages IO are completed to issue the
completion of the RELEASE command, the kernel driver may timeout. The
time to complete N IO messages in the TX queue could be proportional
with the number of pending messages.

In our device implementation [2], RELEASE is handled as follows:
- Drop all messages in the TX queue without outputting in the host.
- Complete the RELEASE control request.

This seems to be working, however, I can observe that sometimes there
are still requests in the TX queue when we get RELEASE. Those requests
are never reproduced in the host.

My questions are:
- In the specification, should we modify it to clarify that all pending
  IO messages in the device are discarded during RELEASE, that is, not
  output to the host, but signaled to the guest as completed?
- According to the specification, should the driver wait in RELEASE an
  amount of time proportional to the number of periods yet to be
  reproduced?

Thanks, Matias.

[1]
https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html
[2]
https://github.com/rust-vmm/vhost-device/tree/main/staging/vhost-device-sound


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/


             reply	other threads:[~2023-10-17 15:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 15:19 Matias Ezequiel Vara Larsen [this message]
2023-10-17 15:29 ` [virtio-comment] Re: virtio-sound: release control request clarification Manos Pitsidianakis
2023-10-18  1:06 ` Anton Yakovlev
2023-10-18 13:30   ` Matias Ezequiel Vara Larsen
2023-10-19  1:39     ` Anton Yakovlev

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=ZS6mA6/EsmvDVlTC@fedora \
    --to=mvaralar@redhat.com \
    --cc=anton.yakovlev@opensynergy.com \
    --cc=jasowang@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).