Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4baf1e3

Browse files
mstsirkinrustyrussell
authored andcommitted
virtio_net: enable VQs early
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, virtio net violated this rule by using receive VQs within probe. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent 3569db5 commit 4baf1e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/virtio_net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,6 +1792,8 @@ static int virtnet_probe(struct virtio_device *vdev)
17921792
goto free_vqs;
17931793
}
17941794

1795+
virtio_device_ready(vdev);
1796+
17951797
/* Last of all, set up some receive buffers. */
17961798
for (i = 0; i < vi->curr_queue_pairs; i++) {
17971799
try_fill_recv(&vi->rq[i], GFP_KERNEL);

0 commit comments

Comments
 (0)