All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
Cc: anton.yakovlev@opensynergy.com, mst@redhat.com, perex@perex.cz,
	tiwai@suse.com, virtualization@lists.linux-foundation.org,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	pbonzini@redhat.com, stefanha@redhat.com, sgarzare@redhat.com,
	manos.pitsidianakis@linaro.org, mripard@redhat.com
Subject: Re: [PATCH v4] ALSA: virtio: use ack callback
Date: Fri, 27 Oct 2023 11:27:40 +0200	[thread overview]
Message-ID: <87cyx0xvn7.wl-tiwai@suse.de> (raw)
In-Reply-To: <ZTjkn1YAFz67yfqx@fedora>

On Wed, 25 Oct 2023 11:49:19 +0200,
Matias Ezequiel Vara Larsen wrote:
> 
> This commit uses the ack() callback to determine when a buffer has been
> updated, then exposes it to guest.
> 
> The current mechanism splits a dma buffer into descriptors that are
> exposed to the device. This dma buffer is shared with the user
> application. When the device consumes a buffer, the driver moves the
> request from the used ring to available ring.
> 
> The driver exposes the buffer to the device without knowing if the
> content has been updated from the user. The section 2.8.21.1 of the
> virtio spec states that: "The device MAY access the descriptor chains
> the driver created and the memory they refer to immediately". If the
> device picks up buffers from the available ring just after it is
> notified, it happens that the content may be old.
> 
> When the ack() callback is invoked, the driver exposes only the buffers
> that have already been updated, i.e., enqueued in the available ring.
> Thus, the device always picks up a buffer that is updated.
> 
> For capturing, the driver starts by exposing all the available buffers
> to device. After device updates the content of a buffer, it enqueues it
> in the used ring. It is only after the ack() for capturing is issued
> that the driver re-enqueues the buffer in the available ring.
> 
> Co-developed-by: Anton Yakovlev <anton.yakovlev@opensynergy.com>
> Signed-off-by: Anton Yakovlev <anton.yakovlev@opensynergy.com>
> Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>

Applied now to for-next branch.


thanks,

Takashi

  reply	other threads:[~2023-10-27  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  9:49 [PATCH v4] ALSA: virtio: use ack callback Matias Ezequiel Vara Larsen
2023-10-25  9:49 ` Matias Ezequiel Vara Larsen
2023-10-27  9:27 ` Takashi Iwai [this message]
2023-10-27 10:18   ` Stefano Garzarella
2023-10-27 10:18     ` Stefano Garzarella
     [not found]     ` <20231027100703-mutt-send-email-mst@kernel.org>
2023-10-31 16:35       ` Stefano Garzarella
2023-10-31 16:35         ` Stefano Garzarella

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=87cyx0xvn7.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=anton.yakovlev@opensynergy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=mripard@redhat.com \
    --cc=mst@redhat.com \
    --cc=mvaralar@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=perex@perex.cz \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=tiwai@suse.com \
    --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 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.