DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/virtio-user: fix vhost-kernel initialization
@ 2023-02-17 12:31 Maxime Coquelin
  2023-02-17 17:27 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Coquelin @ 2023-02-17 12:31 UTC (permalink / raw)
  To: dev, weix.ling, chenbo.xia, david.marchand; +Cc: Maxime Coquelin

This patch fixes a regression causing devices with
Vhost-kernel backends initialization to fail.

Indeed, Vhost-kernel backend init expects
dev->max_queue_pairs to be set at setup time, while its
assignment was moved after backend setup when adding
control queue support for Vhost-vdpa backends.

It is safe to set dev->max_queue_pairs early for
Vhost-kernel backends as if the backend does not support
multiqueue, its setup will fail.

Bugzilla ID: 1161
Fixes: 7be724856315 ("net/virtio-user: get max number of queue pairs from device")

Reported-by: Wei Ling <weix.ling@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index ccb4d7326b..f46a131b5c 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -689,6 +689,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
 
 	dev->started = 0;
 	dev->queue_pairs = 1; /* mq disabled by default */
+	dev->max_queue_pairs = queues; /* initialize to user requested value for kernel backend */
 	dev->queue_size = queue_size;
 	dev->is_server = server;
 	dev->mac_specified = 0;
-- 
2.39.1


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

* Re: [PATCH] net/virtio-user: fix vhost-kernel initialization
  2023-02-17 12:31 [PATCH] net/virtio-user: fix vhost-kernel initialization Maxime Coquelin
@ 2023-02-17 17:27 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2023-02-17 17:27 UTC (permalink / raw)
  To: dev, weix.ling, Maxime Coquelin; +Cc: chenbo.xia, david.marchand

17/02/2023 13:31, Maxime Coquelin:
> This patch fixes a regression causing devices with
> Vhost-kernel backends initialization to fail.
> 
> Indeed, Vhost-kernel backend init expects
> dev->max_queue_pairs to be set at setup time, while its
> assignment was moved after backend setup when adding
> control queue support for Vhost-vdpa backends.
> 
> It is safe to set dev->max_queue_pairs early for
> Vhost-kernel backends as if the backend does not support
> multiqueue, its setup will fail.
> 
> Bugzilla ID: 1161
> Fixes: 7be724856315 ("net/virtio-user: get max number of queue pairs from device")
> 
> Reported-by: Wei Ling <weix.ling@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Applied, thanks.



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

end of thread, other threads:[~2023-02-17 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 12:31 [PATCH] net/virtio-user: fix vhost-kernel initialization Maxime Coquelin
2023-02-17 17:27 ` Thomas Monjalon

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