| 1454 | } |
| 1455 | |
| 1456 | static inline int |
| 1457 | vhost_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 | |
| 1483 | int |
| 1484 | vhost_enable_guest_notification(struct virtio_net *dev, |
no test coverage detected