Re: [PATCH] virtio-vdpa: Use queue id when setting vq affinity

"Michael S. Tsirkin" <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.virtualization
Message-ID <[email protected]>
On Tue, Aug 04, 2026 at 05:26:49PM +0800, Xiong Weimin wrote:
> When optional queues are skipped, pass the compressed vDPA queue id to
> set_vq_affinity() so affinity is applied to the queue that was actually
> created.
> 
> Signed-off-by: Xiong Weimin <[email protected]>


explain what the problem is please. don't just hint.


> ---
>  drivers/virtio/virtio_vdpa.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index de2af696d..6bcf4567a 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -352,7 +352,7 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
>  			continue;
>  		}
>  
> -		vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx++, vqi->callback,
> +		vqs[i] = virtio_vdpa_setup_vq(vdev, queue_idx, vqi->callback,
>  					      vqi->name, vqi->ctx);
>  		if (IS_ERR(vqs[i])) {
>  			err = PTR_ERR(vqs[i]);
> @@ -360,7 +360,8 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
>  		}
>  
>  		if (has_affinity)
> -			ops->set_vq_affinity(vdpa, i, &masks[i]);
> +			ops->set_vq_affinity(vdpa, queue_idx, &masks[i]);
> +		queue_idx++;
>  	}
>  
>  	cb.callback = virtio_vdpa_config_cb;
> -- 
> 2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.