MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_enable_notify_packed

Function vhost_enable_notify_packed

dpdk/lib/vhost/vhost.c:1456–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454}
1455
1456static inline int
1457vhost_enable_notify_packed(struct virtio_net *dev,
1458 struct vhost_virtqueue *vq, int enable)
1459{
1460 uint16_t flags;
1461
1462 if (vq->device_event == NULL)
1463 return -1;
1464
1465 if (!enable) {
1466 vq->device_event->flags = VRING_EVENT_F_DISABLE;
1467 return 0;
1468 }
1469
1470 flags = VRING_EVENT_F_ENABLE;
1471 if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) {
1472 flags = VRING_EVENT_F_DESC;
1473 vq->device_event->off_wrap = vq->last_avail_idx |
1474 vq->avail_wrap_counter << 15;
1475 }
1476
1477 rte_atomic_thread_fence(rte_memory_order_release);
1478
1479 vq->device_event->flags = flags;
1480 return 0;
1481}
1482
1483int
1484vhost_enable_guest_notification(struct virtio_net *dev,

Callers 1

Calls 1

rte_atomic_thread_fenceFunction · 0.50

Tested by

no test coverage detected