aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-09-29 10:01:25 +0000
committerBeno�t Ganne <bganne@cisco.com>2020-09-29 13:34:13 +0000
commit162a296756f3dbead55079e4670973d859df1ef9 (patch)
treec24b836a83a051d809508697ba8871538a0ea040 /src/vnet/devices/virtio/virtio.h
parentd68faf8559da72aa6ad0526d5a86fb16587b1508 (diff)
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>
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r--src/vnet/devices/virtio/virtio.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h
index acefc387549..1cca9f366a8 100644
--- a/src/vnet/devices/virtio/virtio.h
+++ b/src/vnet/devices/virtio/virtio.h
@@ -66,8 +66,15 @@ typedef struct
vring_avail_t *avail;
u16 desc_in_use;
u16 desc_next;
- int kick_fd;
- int call_fd;
+ union
+ {
+ struct
+ {
+ int kick_fd;
+ int call_fd;
+ };
+ u16 queue_notify_offset;
+ };
u8 buffer_pool_index;
u16 size;
u16 queue_id;
@@ -208,9 +215,11 @@ extern void virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr,
extern void virtio_set_packet_coalesce (virtio_if_t * vif);
clib_error_t *virtio_set_packet_buffering (virtio_if_t * vif, u16 size);
extern void virtio_pci_legacy_notify_queue (vlib_main_t * vm,
- virtio_if_t * vif, u16 queue_id);
+ virtio_if_t * vif, u16 queue_id,
+ u16 queue_notify_offset);
extern void virtio_pci_modern_notify_queue (vlib_main_t * vm,
- virtio_if_t * vif, u16 queue_id);
+ virtio_if_t * vif, u16 queue_id,
+ u16 queue_notify_offset);
format_function_t format_virtio_device_name;
format_function_t format_virtio_log_name;
@@ -220,9 +229,11 @@ virtio_kick (vlib_main_t * vm, virtio_vring_t * vring, virtio_if_t * vif)
if (vif->type == VIRTIO_IF_TYPE_PCI)
{
if (vif->is_modern)
- virtio_pci_modern_notify_queue (vm, vif, vring->queue_id);
+ virtio_pci_modern_notify_queue (vm, vif, vring->queue_id,
+ vring->queue_notify_offset);
else
- virtio_pci_legacy_notify_queue (vm, vif, vring->queue_id);
+ virtio_pci_legacy_notify_queue (vm, vif, vring->queue_id,
+ vring->queue_notify_offset);
}
else
{