app/crypto-perf: support lookaside IPsec
[dpdk.git] / lib / vhost / rte_vhost_async.h
index 69ec66b..ad71555 100644 (file)
@@ -59,9 +59,9 @@ struct rte_vhost_async_channel_ops {
         * @param count
         *  number of elements in the "descs" array
         * @return
-        *  number of descs processed
+        *  number of descs processed, negative value means error
         */
-       uint32_t (*transfer_data)(int vid, uint16_t queue_id,
+       int32_t (*transfer_data)(int vid, uint16_t queue_id,
                struct rte_vhost_async_desc *descs,
                struct rte_vhost_async_status *opaque_data,
                uint16_t count);
@@ -76,9 +76,9 @@ struct rte_vhost_async_channel_ops {
         * @param max_packets
         *  max number of packets could be completed
         * @return
-        *  number of async descs completed
+        *  number of async descs completed, negative value means error
         */
-       uint32_t (*check_completed_copies)(int vid, uint16_t queue_id,
+       int32_t (*check_completed_copies)(int vid, uint16_t queue_id,
                struct rte_vhost_async_status *opaque_data,
                uint16_t max_packets);
 };
@@ -103,7 +103,6 @@ enum {
  *  async channel configuration
  */
 struct rte_vhost_async_config {
-       uint32_t async_threshold;
        uint32_t features;
        uint32_t rsvd[2];
 };
@@ -182,13 +181,9 @@ int rte_vhost_async_channel_unregister_thread_unsafe(int vid,
                uint16_t queue_id);
 
 /**
- * This function submits enqueue data to async engine. Successfully
- * enqueued packets can be transfer completed or being occupied by DMA
- * engines, when this API returns. Transfer completed packets are returned
- * in comp_pkts, so users need to guarantee its size is greater than or
- * equal to the size of pkts; for packets that are successfully enqueued
- * but not transfer completed, users should poll transfer status by
- * rte_vhost_poll_enqueue_completed().
+ * This function submits enqueue packets to async copy engine. Users
+ * need to poll transfer status by rte_vhost_poll_enqueue_completed()
+ * for successfully enqueued packets.
  *
  * @param vid
  *  id of vhost device to enqueue data
@@ -198,19 +193,12 @@ int rte_vhost_async_channel_unregister_thread_unsafe(int vid,
  *  array of packets to be enqueued
  * @param count
  *  packets num to be enqueued
- * @param comp_pkts
- *  empty array to get transfer completed packets. Users need to
- *  guarantee its size is greater than or equal to that of pkts
- * @param comp_count
- *  num of packets that are transfer completed, when this API returns.
- *  If no packets are transfer completed, its value is set to 0.
  * @return
- *  num of packets enqueued, including in-flight and transfer completed
+ *  num of packets enqueued
  */
 __rte_experimental
 uint16_t rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id,
-               struct rte_mbuf **pkts, uint16_t count,
-               struct rte_mbuf **comp_pkts, uint32_t *comp_count);
+               struct rte_mbuf **pkts, uint16_t count);
 
 /**
  * This function checks async completion status for a specific vhost
@@ -246,4 +234,26 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,
 __rte_experimental
 int rte_vhost_async_get_inflight(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
+ * returned in an array.
+ *
+ * @note This function does not perform any locking
+ *
+ * @param vid
+ *  ID of vhost device to clear data
+ * @param queue_id
+ *  Queue id to clear data
+ * @param pkts
+ *  Blank array to get return packet pointer
+ * @param count
+ *  Size of the packet array
+ * @return
+ *  Number of packets returned
+ */
+__rte_experimental
+uint16_t rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id,
+               struct rte_mbuf **pkts, uint16_t count);
+
 #endif /* _RTE_VHOST_ASYNC_H_ */