netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] vsock/virtio: enable VQs early on probe
@ 2022-03-22 10:38 Stefano Garzarella
  2022-03-22 13:36 ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Garzarella @ 2022-03-22 10:38 UTC (permalink / raw)
  To: netdev
  Cc: virtualization, Stefano Garzarella, Asias He, David S. Miller,
	Jakub Kicinski, Stefan Hajnoczi, kvm, linux-kernel, Paolo Abeni,
	Michael S. Tsirkin

virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, but virtio-vsock
driver uses VQs in the probe function to fill rx and event VQs
with new buffers.

Let's fix this, calling virtio_device_ready() before using VQs
in the probe function.

Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 net/vmw_vsock/virtio_transport.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 5afc194a58bb..b1962f8cd502 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -622,6 +622,8 @@ static int virtio_vsock_probe(struct virtio_device *vdev)
 	INIT_WORK(&vsock->event_work, virtio_transport_event_work);
 	INIT_WORK(&vsock->send_pkt_work, virtio_transport_send_pkt_work);
 
+	virtio_device_ready(vdev);
+
 	mutex_lock(&vsock->tx_lock);
 	vsock->tx_run = true;
 	mutex_unlock(&vsock->tx_lock);
-- 
2.35.1


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

end of thread, other threads:[~2022-03-22 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 10:38 [PATCH net] vsock/virtio: enable VQs early on probe Stefano Garzarella
2022-03-22 13:36 ` Michael S. Tsirkin
2022-03-22 14:05   ` Stefano Garzarella
2022-03-22 14:09     ` Michael S. Tsirkin
2022-03-22 14:36       ` Stefano Garzarella

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