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

Function rte_vhost_enable_guest_notification

dpdk/lib/vhost/vhost.c:1500–1531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1498}
1499
1500int
1501rte_vhost_enable_guest_notification(int vid, uint16_t queue_id, int enable)
1502{
1503 struct virtio_net *dev = get_device(vid);
1504 struct vhost_virtqueue *vq;
1505 int ret;
1506
1507 if (!dev)
1508 return -1;
1509
1510 if (queue_id >= VHOST_MAX_VRING)
1511 return -1;
1512
1513 vq = dev->virtqueue[queue_id];
1514 if (!vq)
1515 return -1;
1516
1517 rte_rwlock_write_lock(&vq->access_lock);
1518
1519 if (unlikely(!vq->access_ok)) {
1520 ret = -1;
1521 goto out_unlock;
1522 }
1523
1524 vq->notif_enable = enable;
1525 ret = vhost_enable_guest_notification(dev, vq, enable);
1526
1527out_unlock:
1528 rte_rwlock_write_unlock(&vq->access_lock);
1529
1530 return ret;
1531}
1532
1533void
1534rte_vhost_notify_guest(int vid, uint16_t queue_id)

Callers 6

eth_rxq_intr_enableFunction · 0.85
eth_rxq_intr_disableFunction · 0.85
new_deviceFunction · 0.85
mlx5_vdpa_virtq_setupFunction · 0.85
new_deviceFunction · 0.85
new_deviceFunction · 0.85

Calls 2

get_deviceFunction · 0.85

Tested by

no test coverage detected