From: Stefan Hajnoczi <stefanha@redhat.com>
To: Pierre Morel <pmorel@linux.vnet.ibm.com>
Cc: cornelia.huck@de.ibm.com, mst@redhat.com, qemu-devel@nongnu.org,
gkurz@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4] virtio dataplane: adapt dataplane for virtio Version 1
Date: Mon, 7 Sep 2015 11:20:07 +0100 [thread overview]
Message-ID: <20150907102007.GA9593@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1441212824-1459-1-git-send-email-pmorel@linux.vnet.ibm.com>
On Wed, Sep 02, 2015 at 06:53:44PM +0200, Pierre Morel wrote:
> + addr = virtio_queue_get_desc_addr(vdev, n);
> + size = virtio_queue_get_desc_size(vdev, n);
> + ptr = vring_map(&vring->mr_desc, addr, size, true);
> + if (!ptr) {
> + error_report("Failed to map 0x%16lx byte for vring desc at %16lx",
> + size, addr);
> + goto out_err_desc;
> }
> -
> - vring_init(&vring->vr, virtio_queue_get_num(vdev, n), vring_ptr, 4096);
> + vr->desc = ptr;
> +
> + addr = virtio_queue_get_avail_addr(vdev, n);
> + size = virtio_queue_get_avail_size(vdev, n);
> + size += sizeof(__virtio16);
Please add a comment explaining what these 2 bytes are for.
> + ptr = vring_map(&vring->mr_avail, addr, size, true);
> + if (!ptr) {
> + error_report("Failed to map 0x%16lx byte for vring avail at %16lx",
> + size, addr);
> + goto out_err_avail;
> + }
> + vr->avail = ptr;
> +
> + addr = virtio_queue_get_used_addr(vdev, n);
> + size = virtio_queue_get_used_size(vdev, n);
> + size += sizeof(__virtio16);
Here too.
next prev parent reply other threads:[~2015-09-07 10:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 16:53 [Qemu-devel] [PATCH v4] virtio dataplane: adapt dataplane for virtio Version 1 Pierre Morel
2015-09-03 8:44 ` Greg Kurz
2015-09-03 14:59 ` Greg Kurz
2015-09-07 10:20 ` Stefan Hajnoczi [this message]
2015-09-07 10:38 ` Pierre Morel
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=20150907102007.GA9593@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=gkurz@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pmorel@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).