All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-vdpa: Use queue id when setting vq affinity
@ 2026-08-04  9:26 Xiong Weimin
  2026-08-04 21:22 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Xiong Weimin @ 2026-08-04  9:26 UTC (permalink / raw)
  To: Michael S . Tsirkin, Jason Wang
  Cc: Xuan Zhuo, Eugenio Pérez, virtualization, linux-kernel,
	Xiong Weimin

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 <xiongweimin@kylinos.cn>
---
 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


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

* Re: [PATCH] virtio-vdpa: Use queue id when setting vq affinity
  2026-08-04  9:26 [PATCH] virtio-vdpa: Use queue id when setting vq affinity Xiong Weimin
@ 2026-08-04 21:22 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2026-08-04 21:22 UTC (permalink / raw)
  To: Xiong Weimin
  Cc: Jason Wang, Xuan Zhuo, Eugenio Pérez, virtualization,
	linux-kernel

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 <xiongweimin@kylinos.cn>


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


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

end of thread, other threads:[~2026-08-04 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04  9:26 [PATCH] virtio-vdpa: Use queue id when setting vq affinity Xiong Weimin
2026-08-04 21:22 ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.