From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
virtualization@lists.linux-foundation.org,
Anthony Liguori <anthony@codemonkey.ws>,
kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [PATCH 1/3] virtio: find_vqs/del_vqs virtio operations
Date: Fri, 8 May 2009 15:48:22 +0300 [thread overview]
Message-ID: <20090508124821.GA3073@redhat.com> (raw)
In-Reply-To: <200905081637.09729.rusty@rustcorp.com.au>
On Fri, May 08, 2009 at 04:37:06PM +0930, Rusty Russell wrote:
> On Thu, 7 May 2009 11:40:39 pm Michael S. Tsirkin wrote:
> > This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
> > and updates all drivers. This is needed for MSI support, because MSI
> > needs to know the total number of vectors upfront.
>
> Hmm, I have a similar need for a dev to vq mapping (debugging stats). How's
> this as a common basis?
This helps. Should I redo mine on top of this?
> Thanks,
> Rusty.
>
> virtio: add names to virtqueue struct, mapping from devices to queues.
>
> Add a linked list of all virtqueues for a virtio device: this helps for
> debugging and is also needed for upcoming interface change.
>
> Also, add a "name" field for clearer debug messages.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Yes, this will simplify supporting find_vqs.
> @@ -303,10 +313,12 @@ struct virtqueue *vring_new_virtqueue(un
> vq->vq.callback = callback;
> vq->vq.vdev = vdev;
> vq->vq.vq_ops = &vring_vq_ops;
> + vq->vq.name = name;
> vq->notify = notify;
> vq->broken = false;
> vq->last_used_idx = 0;
> vq->num_added = 0;
> + list_add_tail(&vq->vq.list, &vdev->vqs);
> #ifdef DEBUG
> vq->in_use = false;
> #endif
> @@ -327,6 +339,7 @@ EXPORT_SYMBOL_GPL(vring_new_virtqueue);
>
> void vring_del_virtqueue(struct virtqueue *vq)
> {
> + list_del(&vq->list);
> kfree(to_vvq(vq));
> }
> EXPORT_SYMBOL_GPL(vring_del_virtqueue);
I note lack of locking here. This is okay in practice as
drivers don't really call find/del vq in parallel,
but making this explicit with find_vqs will be best, yes?
--
MST
next prev parent reply other threads:[~2009-05-08 12:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1241700929.git.mst@redhat.com>
2009-05-07 14:10 ` [PATCH 1/3] virtio: find_vqs/del_vqs virtio operations Michael S. Tsirkin
2009-05-08 7:07 ` Rusty Russell
2009-05-08 12:48 ` Michael S. Tsirkin [this message]
2009-05-10 4:07 ` Rusty Russell
2009-05-10 7:25 ` Michael S. Tsirkin
2009-05-12 13:03 ` Rusty Russell
2009-05-10 18:51 ` Christian Borntraeger
2009-05-07 14:11 ` [PATCH 2/3] virtio_pci: split up vp_interrupt Michael S. Tsirkin
2009-05-07 14:12 ` [PATCH 3/3] virtio_pci: optional MSI-X support Michael S. Tsirkin
[not found] <cover.1242080138.git.mst@redhat.com>
2009-05-11 22:19 ` [PATCH 1/3] virtio: find_vqs/del_vqs virtio operations Michael S. Tsirkin
2009-05-12 8:55 ` Christian Borntraeger
2009-05-12 14:30 ` Rusty Russell
2009-05-12 15:33 ` Michael S. Tsirkin
2009-05-13 1:17 ` Rusty Russell
2009-05-13 7:18 ` Michael S. Tsirkin
2009-05-13 7:26 ` Avi Kivity
2009-05-13 11:33 ` Rusty Russell
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=20090508124821.GA3073@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--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