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

Function rte_vhost_get_vring_base

dpdk/lib/vhost/vhost.c:1663–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1661}
1662
1663int
1664rte_vhost_get_vring_base(int vid, uint16_t queue_id,
1665 uint16_t *last_avail_idx, uint16_t *last_used_idx)
1666{
1667 struct vhost_virtqueue *vq;
1668 struct virtio_net *dev = get_device(vid);
1669
1670 if (dev == NULL || last_avail_idx == NULL || last_used_idx == NULL)
1671 return -1;
1672
1673 if (queue_id >= VHOST_MAX_VRING)
1674 return -1;
1675
1676 vq = dev->virtqueue[queue_id];
1677 if (!vq)
1678 return -1;
1679
1680 if (vq_is_packed(dev)) {
1681 *last_avail_idx = (vq->avail_wrap_counter << 15) |
1682 vq->last_avail_idx;
1683 *last_used_idx = (vq->used_wrap_counter << 15) |
1684 vq->last_used_idx;
1685 } else {
1686 *last_avail_idx = vq->last_avail_idx;
1687 *last_used_idx = vq->last_used_idx;
1688 }
1689
1690 return 0;
1691}
1692
1693int
1694rte_vhost_set_vring_base(int vid, uint16_t queue_id,

Callers 7

nfp_vdpa_startFunction · 0.85
vdpa_ifcvf_startFunction · 0.85
m_ifcvf_startFunction · 0.85
ifcvf_config_vringFunction · 0.85
sfc_vdpa_get_vring_infoFunction · 0.85
new_deviceFunction · 0.85

Calls 2

get_deviceFunction · 0.85
vq_is_packedFunction · 0.85

Tested by

no test coverage detected