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

Function rte_vhost_set_vring_base

dpdk/lib/vhost/vhost.c:1693–1721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1691}
1692
1693int
1694rte_vhost_set_vring_base(int vid, uint16_t queue_id,
1695 uint16_t last_avail_idx, uint16_t last_used_idx)
1696{
1697 struct vhost_virtqueue *vq;
1698 struct virtio_net *dev = get_device(vid);
1699
1700 if (!dev)
1701 return -1;
1702
1703 if (queue_id >= VHOST_MAX_VRING)
1704 return -1;
1705
1706 vq = dev->virtqueue[queue_id];
1707 if (!vq)
1708 return -1;
1709
1710 if (vq_is_packed(dev)) {
1711 vq->last_avail_idx = last_avail_idx & 0x7fff;
1712 vq->avail_wrap_counter = !!(last_avail_idx & (1 << 15));
1713 vq->last_used_idx = last_used_idx & 0x7fff;
1714 vq->used_wrap_counter = !!(last_used_idx & (1 << 15));
1715 } else {
1716 vq->last_avail_idx = last_avail_idx;
1717 vq->last_used_idx = last_used_idx;
1718 }
1719
1720 return 0;
1721}
1722
1723int
1724rte_vhost_get_vring_base_from_inflight(int vid,

Callers 6

nfp_vdpa_stopFunction · 0.85
mlx5_vdpa_virtq_queryFunction · 0.85
vdpa_ifcvf_stopFunction · 0.85
m_ifcvf_stopFunction · 0.85
ifcvf_config_vringFunction · 0.85
destroy_deviceFunction · 0.85

Calls 2

get_deviceFunction · 0.85
vq_is_packedFunction · 0.85

Tested by

no test coverage detected