X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fprog_guide%2Fvhost_lib.rst;h=171e0096f6d4ca44de6f122cc12ec173ff47a6f4;hb=e0ad8d2bdafcd74eb960bf96507fed11cc97d58c;hp=ba4c62aeb84426a6185628c8b7cccd94fe95b56c;hpb=cacf8267cc14e84384dbc86f24f6b10e8aedbcbc;p=dpdk.git diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index ba4c62aeb8..171e0096f6 100644 --- a/doc/guides/prog_guide/vhost_lib.rst +++ b/doc/guides/prog_guide/vhost_lib.rst @@ -118,6 +118,18 @@ The following is an overview of some key Vhost API functions: It is disabled by default. + - ``RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS`` + + Since v16.04, the vhost library forwards checksum and gso requests for + packets received from a virtio driver by filling Tx offload metadata in + the mbuf. This behavior is inconsistent with other drivers but it is left + untouched for existing applications that might rely on it. + + This flag disables the legacy behavior and instead ask vhost to simply + populate Rx offload metadata in the mbuf. + + It is disabled by default. + * ``rte_vhost_driver_set_features(path, features)`` This function sets the feature bits the vhost-user driver supports. The @@ -206,26 +218,22 @@ The following is an overview of some key Vhost API functions: Enable or disable zero copy feature of the vhost crypto backend. -* ``rte_vhost_async_channel_register(vid, queue_id, features, ops)`` +* ``rte_vhost_async_channel_register(vid, queue_id, config, ops)`` - Register a vhost queue with async copy device channel. - Following device ``features`` must be specified together with the - registration: + Register an async copy device channel for a vhost queue after vring + is enabled. Following device ``config`` must be specified together + with the registration: - * ``async_inorder`` + * ``features`` - Async copy device can guarantee the ordering of copy completion - sequence. Copies are completed in the same order with that at - the submission time. + This field is used to specify async copy device features. - Currently, only ``async_inorder`` capable device is supported by vhost. + ``RTE_VHOST_ASYNC_INORDER`` represents the async copy device can + guarantee the order of copy completion is the same as the order + of copy submission. - * ``async_threshold`` - - The copy length (in bytes) below which CPU copy will be used even if - applications call async vhost APIs to enqueue/dequeue data. - - Typical value is 512~1024 depending on the async device capability. + Currently, only ``RTE_VHOST_ASYNC_INORDER`` capable device is + supported by vhost. Applications must provide following ``ops`` callbacks for vhost lib to work with the async copy devices: @@ -241,15 +249,41 @@ The following is an overview of some key Vhost API functions: vhost invokes this function to get the copy data completed by async devices. +* ``rte_vhost_async_channel_register_thread_unsafe(vid, queue_id, config, ops)`` + + Register an async copy device channel for a vhost queue without + performing any locking. + + This function is only safe to call in vhost callback functions + (i.e., struct vhost_device_ops). + * ``rte_vhost_async_channel_unregister(vid, queue_id)`` Unregister the async copy device channel from a vhost queue. + Unregistration will fail, if the vhost queue has in-flight + packets that are not completed. + + Unregister async copy devices in vring_state_changed() may + fail, as this API tries to acquire the spinlock of vhost + queue. The recommended way is to unregister async copy + devices for all vhost queues in destroy_device(), when a + virtio device is paused or shut down. + +* ``rte_vhost_async_channel_unregister_thread_unsafe(vid, queue_id)`` + + Unregister the async copy device channel for a vhost queue without + performing any locking. + + This function is only safe to call in vhost callback functions + (i.e., struct vhost_device_ops). -* ``rte_vhost_submit_enqueue_burst(vid, queue_id, pkts, count)`` +* ``rte_vhost_submit_enqueue_burst(vid, queue_id, pkts, count, comp_pkts, comp_count)`` Submit an enqueue request to transmit ``count`` packets from host to guest - by async data path. Enqueue is not guaranteed to finish upon the return of - this API call. + by async data path. Successfully enqueued packets can be transfer completed + or being occupied by DMA engines; transfer completed packets are returned in + ``comp_pkts``, but others are not guaranteed to finish, when this API + call returns. Applications must not free the packets submitted for enqueue until the packets are completed. @@ -259,6 +293,16 @@ The following is an overview of some key Vhost API functions: Poll enqueue completion status from async data path. Completed packets are returned to applications through ``pkts``. +* ``rte_vhost_async_get_inflight(vid, queue_id)`` + + This function returns the amount of in-flight packets for the vhost + queue using async acceleration. + +* ``rte_vhost_clear_queue_thread_unsafe(vid, queue_id, **pkts, count)`` + + Clear inflight packets which are submitted to DMA engine in vhost async data + path. Completed packets are returned to applications through ``pkts``. + Vhost-user Implementations --------------------------