Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "virtio-dev@lists.oasis-open.org" <virtio-dev@lists.oasis-open.org>
Subject: Re: [virtio-dev] virtio-spec: Clarify /wrt maintaining a split-queue descriptors
Date: Sun, 27 Oct 2019 07:37:42 -0400	[thread overview]
Message-ID: <20191027073636-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <19cb1e74-66ac-3658-ff01-1414b5039158@siemens.com>

On Sat, Oct 12, 2019 at 09:20:02AM +0200, Jan Kiszka wrote:
> Hi all,
> 
> I'm wondering if the spec is clear enough regarding who is in charge of
> setting fields in a descriptor of split virtqueues. Background: I just
> made the mistake in an experimental backend of writing back the number
> of bytes pushed into a buffer not only in virtq_used_elem but also the
> referenced virtq_desc - with unpleasant effects for the guest.
> 
> The spec in section 2.6.8 reads to me like virtq_used_elem.len is rather
> informative. At least this section leaves it fuzzy to me whether there
> are other sources from where a driver can find out how much a device has
> delivered - and misled me to also update virtq_desc.len in the device.
> 
> But maybe I'm missing a clear note in another section.
> 
> Jan


Well it does say this:

	When the driver wants to send a buffer to the device, it fills in
	a slot in the descriptor table (or chains several together), and
	writes the descriptor index into the available ring.  It then
	notifies the device. When the device has finished a buffer, it
	writes the descriptor index into the used ring, and sends a
	used buffer notification.

but for sure, documenting that descriptor area is read-only by device
can't hurt.

> -- 
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


---------------------------------------------------------------------
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:[~2019-10-27 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12  7:20 [virtio-dev] virtio-spec: Clarify /wrt maintaining a split-queue descriptors Jan Kiszka
2019-10-27 11:37 ` Michael S. Tsirkin [this message]

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=20191027073636-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --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