linux/drivers/virtio
Mao Wenan 481a0d7422 virtio_ring: Avoid loop when vq is broken in virtqueue_poll
The loop may exist if vq->broken is true,
virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.

call trace as below:
virtnet_poll
	virtnet_receive
		virtqueue_get_buf_ctx
			virtqueue_get_buf_ctx_packed
			virtqueue_get_buf_ctx_split
	virtqueue_napi_complete
		virtqueue_poll           //return true
		virtqueue_napi_schedule //it will reschedule napi

to fix this, return false if vq is broken in virtqueue_poll.

Signed-off-by: Mao Wenan <wenan.mao@linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/1596354249-96204-1-git-send-email-wenan.mao@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2020-08-05 11:08:41 -04:00
..
Kconfig virtio-mem: Fix build error due to improper use 'select' 2020-07-30 11:28:17 -04:00
Makefile virtio-mem: Paravirtualized memory hotplug 2020-06-04 15:36:52 -04:00
virtio_balloon.c virtio_balloon: use LE config space accesses 2020-08-05 11:08:41 -04:00
virtio_input.c virtio_input: convert to LE accessors 2020-08-05 11:08:41 -04:00
virtio_mem.c virtio_mem: convert to LE accessors 2020-08-05 11:08:41 -04:00
virtio_mmio.c virtio-mmio: Reject invalid IRQ 0 command line argument 2020-07-22 10:31:45 -05:00
virtio_pci_common.c virtio-pci: check name when counting MSI-X vectors 2020-02-06 03:40:26 -05:00
virtio_pci_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_pci_legacy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_pci_modern.c virtio: add VIRTIO_RING_NO_LEGACY 2020-06-02 02:45:13 -04:00
virtio_ring.c virtio_ring: Avoid loop when vq is broken in virtqueue_poll 2020-08-05 11:08:41 -04:00
virtio_vdpa.c virtio_vdpa: legacy features handling 2020-08-05 11:08:40 -04:00
virtio.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00