This function returns the amount of in-flight packets for the vhost
queue using async acceleration.
+ * ``rte_vhost_async_get_inflight_thread_unsafe(vid, queue_id)``
+
+ Get the number of inflight packets for a vhost queue without performing
+ any locking. It should only be used within the vhost ops, which already
+ holds the lock.
+
* ``rte_vhost_clear_queue_thread_unsafe(vid, queue_id, **pkts, count, dma_id, vchan_id)``
Clear inflight packets which are submitted to DMA engine in vhost async data
Also, make sure to start the actual text at the margin.
=======================================================
+* **Added vhost API to get the number of in-flight packets.**
+
+ Added an API which can get the number of in-flight packets in
+ vhost async data path without using lock.
+
* **Updated Intel iavf driver.**
* Added Tx QoS queue rate limitation support.
__rte_experimental
int rte_vhost_async_get_inflight(int vid, uint16_t queue_id);
+/**
+ * This function is lock-free version to return the amount of in-flight
+ * packets for the vhost queue which uses async channel acceleration.
+ *
+ * @note This function does not perform any locking, it should only be
+ * used within the vhost ops, which already holds the lock.
+ *
+ * @param vid
+ * id of vhost device to enqueue data
+ * @param queue_id
+ * queue id to enqueue data
+ * @return
+ * the amount of in-flight packets on success; -1 on failure
+ */
+__rte_experimental
+int rte_vhost_async_get_inflight_thread_unsafe(int vid, uint16_t queue_id);
+
/**
* This function checks async completion status and clear packets for
* a specific vhost device queue. Packets which are inflight will be
# added in 22.03
rte_vhost_async_dma_configure;
+
+ # added in 22.07
+ rte_vhost_async_get_inflight_thread_unsafe;
+
};
INTERNAL {
return ret;
}
+int
+rte_vhost_async_get_inflight_thread_unsafe(int vid, uint16_t queue_id)
+{
+ struct vhost_virtqueue *vq;
+ struct virtio_net *dev = get_device(vid);
+ int ret = -1;
+
+ if (dev == NULL)
+ return ret;
+
+ if (queue_id >= VHOST_MAX_VRING)
+ return ret;
+
+ vq = dev->virtqueue[queue_id];
+
+ if (vq == NULL)
+ return ret;
+
+ if (!vq->async)
+ return ret;
+
+ ret = vq->async->pkts_inflight_n;
+
+ return ret;
+}
+
int
rte_vhost_get_monitor_addr(int vid, uint16_t queue_id,
struct rte_vhost_power_monitor_cond *pmc)