1
0
Fork 0
alistair23-linux/drivers/virtio
Mao Wenan 05724341d9 virtio_ring: Avoid loop when vq is broken in virtqueue_poll
[ Upstream commit 481a0d7422 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:40:57 +02:00
..
Kconfig virtio-pmem: Add virtio pmem driver 2019-07-05 15:19:10 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virtio.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
virtio_balloon.c virtio_balloon: fix up endian-ness for free cmd id 2020-08-05 09:59:43 +02:00
virtio_input.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
virtio_mmio.c virtio-mmio: add error check for platform_get_irq 2019-07-11 16:22:29 -04:00
virtio_pci_common.c virtio-pci: check name when counting MSI-X vectors 2020-02-11 04:35:43 -08: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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_ring.c virtio_ring: Avoid loop when vq is broken in virtqueue_poll 2020-08-26 10:40:57 +02:00