freebsd-dev/sys/dev/virtio
Vincenzo Maffione 16f224b5f8 netmap: vtnet: fix races in vtnet_netmap_reg()
The nm_register callback needs to call nm_set_native_flags()
or nm_clear_native_flags() once the device has been stopped.
However, in the current implementation this is not true,
as the device is stopped by vtnet_init_locked(). This causes
race conditions where the driver crashes as soon as it
dequeues netmap buffers assuming they are mbufs (or the other
way around).
To fix the issue, we extend vtnet_init_locked() with a second
argument that, if not zero, will set/clear the netmap flags.
This results in a huge simplification of the nm_register
callback itself.
Also, use netmap_reset() to check if a ring is going to be
re-initialized in netmap mode.

MFC after:	1 week
2020-06-14 20:47:31 +00:00
..
balloon virtio: Support MMIO bus for all devices 2020-05-06 23:31:30 +00:00
block Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
console virtio: Support MMIO bus for all devices 2020-05-06 23:31:30 +00:00
mmio virtio_mmio: Negotiate the upper half of the feature bits too 2020-06-08 21:49:42 +00:00
network netmap: vtnet: fix races in vtnet_netmap_reg() 2020-06-14 20:47:31 +00:00
pci [virtio] Fix r/w to PCI configuration area on big endian platforms 2020-02-05 20:39:18 +00:00
random virtio: Support MMIO bus for all devices 2020-05-06 23:31:30 +00:00
scsi virtio: Support MMIO bus for all devices 2020-05-06 23:31:30 +00:00
virtio_bus_if.m
virtio_config.h Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers 2018-06-17 20:45:48 +00:00
virtio_ids.h
virtio_if.m
virtio_ring.h Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers 2018-06-17 20:45:48 +00:00
virtio.c virtio: Support non-legacy network device and queue 2020-06-08 21:51:36 +00:00
virtio.h virtio(4): Add PNP match metadata for virtio devices 2019-06-04 02:37:11 +00:00
virtqueue.c virtio: Support non-legacy network device and queue 2020-06-08 21:51:36 +00:00
virtqueue.h Add more virtqueue getter methods 2018-02-19 19:31:18 +00:00