X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Frte_vhost_async.h;h=c855ff875e272b0b23e3f7e908d3003214ff7e1d;hb=2b9a66e1b606d3813d72dd81c626949e09706e27;hp=cb6284539d7125a98369eda673cff5246e0fbfb5;hpb=819a716858264d6c90f554e4fe53740b42c4c893;p=dpdk.git diff --git a/lib/librte_vhost/rte_vhost_async.h b/lib/librte_vhost/rte_vhost_async.h index cb6284539d..c855ff875e 100644 --- a/lib/librte_vhost/rte_vhost_async.h +++ b/lib/librte_vhost/rte_vhost_async.h @@ -76,13 +76,21 @@ struct rte_vhost_async_channel_ops { * @param max_packets * max number of packets could be completed * @return - * number of iov segments completed + * number of async descs completed */ uint32_t (*check_completed_copies)(int vid, uint16_t queue_id, struct rte_vhost_async_status *opaque_data, uint16_t max_packets); }; +/** + * inflight async packet information + */ +struct async_inflight_info { + struct rte_mbuf *mbuf; + uint16_t descs; /* num of descs inflight */ +}; + /** * dma channel feature bit definition */ @@ -99,7 +107,7 @@ struct rte_vhost_async_features { }; /** - * register a async channel for vhost + * register an async channel for vhost * * @param vid * vhost device id async channel to be attached to @@ -134,9 +142,13 @@ __rte_experimental int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id); /** - * This function submit enqueue data to async engine. This function has - * no guranttee to the transfer completion upon return. Applications - * should poll transfer status by rte_vhost_poll_enqueue_completed() + * 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(). * * @param vid * id of vhost device to enqueue data @@ -146,15 +158,22 @@ int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id); * 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 + * num of packets enqueued, including in-flight and transfer completed */ __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 **pkts, uint16_t count, + struct rte_mbuf **comp_pkts, uint32_t *comp_count); /** - * This function check async completion status for a specific vhost + * This function checks async completion status for a specific vhost * device queue. Packets which finish copying (enqueue) operation * will be returned in an array. *