From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, aliguori@us.ibm.com, stefanha@redhat.com,
qemu-devel@nongnu.org
Cc: krkumar2@in.ibm.com, kvm@vger.kernel.org, mprivozn@redhat.com,
Jason Wang <jasowang@redhat.com>,
rusty@rustcorp.com.au, jwhan@filewood.snu.ac.kr,
shiyer@redhat.com
Subject: [Qemu-devel] [PATCH 08/12] virtio: add a queue_index to VirtQueue
Date: Fri, 28 Dec 2012 18:32:00 +0800 [thread overview]
Message-ID: <1356690724-37891-9-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1356690724-37891-1-git-send-email-jasowang@redhat.com>
Add a queue_index to VirtQueue and a helper to fetch it, this could be used by
multiqueue supported device.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio.c | 8 ++++++++
hw/virtio.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/hw/virtio.c b/hw/virtio.c
index bc3c9c3..726c139 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -72,6 +72,8 @@ struct VirtQueue
/* Notification enabled? */
bool notification;
+ uint16_t queue_index;
+
int inuse;
uint16_t vector;
@@ -929,6 +931,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id,
for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) {
vdev->vq[i].vector = VIRTIO_NO_VECTOR;
vdev->vq[i].vdev = vdev;
+ vdev->vq[i].queue_index = i;
}
vdev->name = name;
@@ -1008,6 +1011,11 @@ VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n)
return vdev->vq + n;
}
+uint16_t virtio_get_queue_index(VirtQueue *vq)
+{
+ return vq->queue_index;
+}
+
static void virtio_queue_guest_notifier_read(EventNotifier *n)
{
VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);
diff --git a/hw/virtio.h b/hw/virtio.h
index f6cb0f9..07b38d6 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -237,6 +237,7 @@ hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
+uint16_t virtio_get_queue_index(VirtQueue *vq);
int virtio_queue_get_id(VirtQueue *vq);
EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq);
void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign,
--
1.7.1
next prev parent reply other threads:[~2012-12-28 10:41 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 10:31 [Qemu-devel] [PATCH 00/12] Multiqueue virtio-net Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 01/12] tap: multiqueue support Jason Wang
2013-01-09 9:56 ` Stefan Hajnoczi
2013-01-09 15:25 ` Jason Wang
2013-01-10 8:32 ` Stefan Hajnoczi
2013-01-10 10:28 ` Stefan Hajnoczi
2013-01-10 13:52 ` Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 02/12] net: introduce qemu_get_queue() Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 03/12] net: introduce qemu_get_nic() Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 04/12] net: intorduce qemu_del_nic() Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 05/12] net: multiqueue support Jason Wang
2012-12-28 18:06 ` Blue Swirl
2012-12-28 10:31 ` [Qemu-devel] [PATCH 06/12] vhost: " Jason Wang
2012-12-28 10:31 ` [Qemu-devel] [PATCH 07/12] virtio: introduce virtio_queue_del() Jason Wang
2013-01-08 7:14 ` Michael S. Tsirkin
2013-01-08 9:28 ` Jason Wang
2012-12-28 10:32 ` Jason Wang [this message]
2012-12-28 10:32 ` [Qemu-devel] [PATCH 09/12] virtio-net: separate virtqueue from VirtIONet Jason Wang
2012-12-28 10:32 ` [Qemu-devel] [PATCH 10/12] virtio-net: multiqueue support Jason Wang
2012-12-28 17:52 ` Blue Swirl
2013-01-04 5:12 ` Jason Wang
2013-01-04 20:41 ` Blue Swirl
2013-01-08 9:07 ` Wanlong Gao
2013-01-08 9:29 ` Jason Wang
2013-01-08 9:32 ` Wanlong Gao
2013-01-08 9:49 ` Wanlong Gao
2013-01-08 9:51 ` Jason Wang
2013-01-08 10:00 ` Wanlong Gao
2013-01-08 10:14 ` Jason Wang
2013-01-08 11:24 ` Wanlong Gao
2013-01-09 3:11 ` Jason Wang
2013-01-09 8:23 ` Wanlong Gao
2013-01-09 9:30 ` Jason Wang
2013-01-09 10:01 ` Wanlong Gao
2013-01-09 15:26 ` Jason Wang
2013-01-10 6:43 ` Jason Wang
2013-01-10 6:49 ` Wanlong Gao
2013-01-10 7:16 ` Jason Wang
2013-01-10 9:06 ` Wanlong Gao
2013-01-10 9:40 ` Jason Wang
2012-12-28 10:32 ` [Qemu-devel] [PATCH 11/12] virtio-net: migration support for multiqueue Jason Wang
2013-01-08 7:10 ` Michael S. Tsirkin
2013-01-08 9:27 ` Jason Wang
2012-12-28 10:32 ` [Qemu-devel] [PATCH 12/12] virtio-net: compat multiqueue support Jason Wang
2013-01-09 14:29 ` [Qemu-devel] [PATCH 00/12] Multiqueue virtio-net Stefan Hajnoczi
2013-01-09 15:32 ` Michael S. Tsirkin
2013-01-09 15:33 ` Jason Wang
2013-01-10 8:44 ` Stefan Hajnoczi
2013-01-10 9:34 ` Jason Wang
2013-01-10 11:49 ` Stefan Hajnoczi
2013-01-10 14:15 ` Jason Wang
2013-01-14 19:44 ` Anthony Liguori
2013-01-15 10:12 ` Jason Wang
2013-01-16 15:09 ` Anthony Liguori
2013-01-16 15:19 ` Michael S. Tsirkin
2013-01-16 16:14 ` Anthony Liguori
2013-01-16 16:48 ` Michael S. Tsirkin
2013-01-17 10:31 ` Michael S. Tsirkin
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=1356690724-37891-9-git-send-email-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=jwhan@filewood.snu.ac.kr \
--cc=krkumar2@in.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mprivozn@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
--cc=shiyer@redhat.com \
--cc=stefanha@redhat.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 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).