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

Function rte_vhost_async_channel_register

dpdk/lib/vhost/vhost.c:1844–1875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1842}
1843
1844int
1845rte_vhost_async_channel_register(int vid, uint16_t queue_id)
1846{
1847 struct vhost_virtqueue *vq;
1848 struct virtio_net *dev = get_device(vid);
1849 int ret;
1850
1851 if (dev == NULL)
1852 return -1;
1853
1854 if (queue_id >= VHOST_MAX_VRING)
1855 return -1;
1856
1857 vq = dev->virtqueue[queue_id];
1858
1859 if (unlikely(vq == NULL || !dev->async_copy || dev->vdpa_dev != NULL))
1860 return -1;
1861
1862 rte_rwlock_write_lock(&vq->access_lock);
1863
1864 if (unlikely(!vq->access_ok)) {
1865 ret = -1;
1866 goto out_unlock;
1867 }
1868
1869 ret = async_channel_register(dev, vq);
1870
1871out_unlock:
1872 rte_rwlock_write_unlock(&vq->access_lock);
1873
1874 return ret;
1875}
1876
1877int
1878rte_vhost_async_channel_register_thread_unsafe(int vid, uint16_t queue_id)

Callers 1

Calls 2

get_deviceFunction · 0.85
async_channel_registerFunction · 0.85

Tested by

no test coverage detected