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

Function rte_vhost_get_vhost_vring

dpdk/lib/vhost/vhost.c:984–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

982}
983
984int
985rte_vhost_get_vhost_vring(int vid, uint16_t vring_idx,
986 struct rte_vhost_vring *vring)
987{
988 struct virtio_net *dev;
989 struct vhost_virtqueue *vq;
990
991 dev = get_device(vid);
992 if (dev == NULL || vring == NULL)
993 return -1;
994
995 if (vring_idx >= VHOST_MAX_VRING)
996 return -1;
997
998 vq = dev->virtqueue[vring_idx];
999 if (!vq)
1000 return -1;
1001
1002 if (vq_is_packed(dev)) {
1003 vring->desc_packed = vq->desc_packed;
1004 vring->driver_event = vq->driver_event;
1005 vring->device_event = vq->device_event;
1006 } else {
1007 vring->desc = vq->desc;
1008 vring->avail = vq->avail;
1009 vring->used = vq->used;
1010 }
1011 vring->log_guest_addr = vq->log_guest_addr;
1012
1013 vring->callfd = vq->callfd;
1014 vring->kickfd = vq->kickfd;
1015 vring->size = vq->size;
1016
1017 return 0;
1018}
1019
1020int
1021rte_vhost_get_vhost_ring_inflight(int vid, uint16_t vring_idx,

Callers 15

eth_vhost_update_intrFunction · 0.85
nfp_vdpa_startFunction · 0.85
mlx5_vdpa_virtq_setupFunction · 0.85
mlx5_vdpa_virtqs_prepareFunction · 0.85
vdpa_ifcvf_startFunction · 0.85
vdpa_enable_vfio_intrFunction · 0.85
notify_relayFunction · 0.85
m_ifcvf_startFunction · 0.85

Calls 2

get_deviceFunction · 0.85
vq_is_packedFunction · 0.85

Tested by

no test coverage detected