virtio: fix modern device queue notify
QUEUE_SELECT and QUEUE_NOTIFY_OFF registers are shared between all
workers operating on the same device and operations are not atomic
Type: fix
Change-Id: Ie017b1bfc7e3b6b4e59029f45db78eeffd9f3aeb
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/vnet/devices/virtio/virtio_pci_legacy.c b/src/vnet/devices/virtio/virtio_pci_legacy.c
index cf1d841..1426a70 100644
--- a/src/vnet/devices/virtio/virtio_pci_legacy.c
+++ b/src/vnet/devices/virtio/virtio_pci_legacy.c
@@ -203,9 +203,16 @@
vlib_pci_write_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_PFN, &src);
}
+static u16
+virtio_pci_legacy_get_queue_notify_off (vlib_main_t * vm, virtio_if_t * vif,
+ u16 queue_id)
+{
+ return 0;
+}
+
inline void
virtio_pci_legacy_notify_queue (vlib_main_t * vm, virtio_if_t * vif,
- u16 queue_id)
+ u16 queue_id, u16 queue_notify_off)
{
vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_NOTIFY,
&queue_id);
@@ -364,6 +371,7 @@
.set_queue_size = virtio_pci_legacy_set_queue_num,
.setup_queue = virtio_pci_legacy_setup_queue,
.del_queue = virtio_pci_legacy_del_queue,
+ .get_queue_notify_off = virtio_pci_legacy_get_queue_notify_off,
.notify_queue = virtio_pci_legacy_notify_queue,
.set_config_irq = virtio_pci_legacy_set_config_irq,
.set_queue_irq = virtio_pci_legacy_set_queue_irq,