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

Function rte_vhost_async_get_inflight

dpdk/lib/vhost/vhost.c:2055–2091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2053}
2054
2055int
2056rte_vhost_async_get_inflight(int vid, uint16_t queue_id)
2057{
2058 struct vhost_virtqueue *vq;
2059 struct virtio_net *dev = get_device(vid);
2060 int ret = -1;
2061
2062 if (dev == NULL)
2063 return ret;
2064
2065 if (queue_id >= VHOST_MAX_VRING)
2066 return ret;
2067
2068 vq = dev->virtqueue[queue_id];
2069
2070 if (vq == NULL)
2071 return ret;
2072
2073 if (rte_rwlock_write_trylock(&vq->access_lock)) {
2074 VHOST_LOG_CONFIG(dev->ifname, DEBUG,
2075 "failed to check in-flight packets. virtqueue busy.\n");
2076 return ret;
2077 }
2078
2079 if (unlikely(!vq->access_ok)) {
2080 ret = -1;
2081 goto out_unlock;
2082 }
2083
2084 if (vq->async)
2085 ret = vq->async->pkts_inflight_n;
2086
2087out_unlock:
2088 rte_rwlock_write_unlock(&vq->access_lock);
2089
2090 return ret;
2091}
2092
2093int
2094rte_vhost_async_get_inflight_thread_unsafe(int vid, uint16_t queue_id)

Callers 1

vhost_clear_queueFunction · 0.85

Calls 1

get_deviceFunction · 0.85

Tested by

no test coverage detected