virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Subject: Re: find_vqs operation starting at arbitrary index
Date: Mon, 1 Jun 2009 11:11:06 +0300	[thread overview]
Message-ID: <20090601081106.GA5061@redhat.com> (raw)
In-Reply-To: <20090601080348.GA17119@amit-x200.pnq.redhat.com>

On Mon, Jun 01, 2009 at 01:33:48PM +0530, Amit Shah wrote:
> 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.

How, specifically?

> 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

  reply	other threads:[~2009-06-01  8:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01  8:03 find_vqs operation starting at arbitrary index Amit Shah
2009-06-01  8:11 ` Michael S. Tsirkin [this message]
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

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=20090601081106.GA5061@redhat.com \
    --to=mst@redhat.com \
    --cc=amit.shah@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).