virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* find_vqs operation starting at arbitrary index
@ 2009-06-01  8:03 Amit Shah
  2009-06-01  8:11 ` Michael S. Tsirkin
  2009-06-01 23:23 ` Rusty Russell
  0 siblings, 2 replies; 11+ messages in thread
From: Amit Shah @ 2009-06-01  8:03 UTC (permalink / raw)
  To: mst, rusty; +Cc: virtualization

Hello,

The recent find_vqs operation doesn't allow for a vq to be found at an
arbitrary location; it's meant to be called once at startup to find all
possible queues and never called again.

This doesn't work for devices which can have queues hot-plugged at
run-time. This can be made to work by passing the 'start_index' value as
was done earlier for find_vq, but I doubt something like the following
will work. The MSI vectors might need some changing as well.

If this indeed is the right way to do it, I can add a

virtio_find_vqs helper along similar lines as virtio_find_single_vq and
pass '0' as the start index to the ->find_vqs operation.

Or is there another way to do it?

diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 193c8f0..cb3f8df 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -499,7 +499,7 @@ static void vp_del_vqs(struct virtio_device *vdev)
 
 /* the config->find_vqs() implementation */
 static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
-		       struct virtqueue *vqs[],
+		       unsigned start_index, struct virtqueue *vqs[],
 		       vq_callback_t *callbacks[],
 		       const char *names[])
 {
@@ -516,7 +516,8 @@ static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
 		goto error_request;
 
 	for (i = 0; i < nvqs; ++i) {
-		vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i]);
+		vqs[i] = vp_find_vq(vdev, start_index + i, callbacks[i],
+				    names[i]);
 		if (IS_ERR(vqs[i]))
 			goto error_find;
 	}



		Amit

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-02 17:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01  8:03 find_vqs operation starting at arbitrary index Amit Shah
2009-06-01  8:11 ` Michael S. Tsirkin
2009-06-01  8:35   ` Amit Shah
2009-06-01  8:43     ` Michael S. Tsirkin
2009-06-01  8:51       ` Amit Shah
2009-06-01  9:12         ` Michael S. Tsirkin
2009-06-01  9:45         ` Michael S. Tsirkin
2009-06-01 23:23 ` Rusty Russell
2009-06-02 16:32   ` Michael S. Tsirkin
2009-06-02 17:09     ` Amit Shah
2009-06-02 17:23       ` Michael S. Tsirkin

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).