[PATCH 0/4] virtio-net: don't busy poll for cvq command

From: Jason Wang
Date: Mon Dec 26 2022 - 02:50:09 EST


Hi all:

The code used to busy poll for cvq command which turns out to have
several side effects:

1) infinite poll for buggy devices
2) bad interaction with scheduler

So this series tries to use sleep + timeout instead of busy polling.

Please review.

Thanks

Changes since RFC:

- switch to use BAD_RING in virtio_break_device()
- check virtqueue_is_broken() after being woken up
- use more_used() instead of virtqueue_get_buf() to allow caller to
get buffers afterwards
- break the virtio-net device when timeout
- get buffer manually since the virtio core check more_used() instead

Jason Wang (4):
virtio-net: convert rx mode setting to use workqueue
virtio_ring: switch to use BAD_RING()
virtio_ring: introduce a per virtqueue waitqueue
virtio-net: sleep instead of busy waiting for cvq command

drivers/net/virtio_net.c | 90 +++++++++++++++++++++++++++++++-----
drivers/virtio/virtio_ring.c | 37 +++++++++++++--
include/linux/virtio.h | 3 ++
3 files changed, 115 insertions(+), 15 deletions(-)

--
2.25.1