[dpdk-dev] [PATCH v3 8/8] raw/ioat: add local API to perform copies

Burakov, Anatoly anatoly.burakov at intel.com
Thu Jun 27 14:45:20 CEST 2019


On 27-Jun-19 11:40 AM, Bruce Richardson wrote:
> Add local APIs to trigger data copies, and retrieve handle values once
> those copies are completed. Included are unit tests to validate the data
> is copies correctly.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> 
> ---
> 
> V3: updated to use descriptor format in rte_ioat_spec.h
> V2: test cases moved to self-test routine
> ---
>   doc/guides/rawdevs/ioat_rawdev.rst  | 100 ++++++++++++++++
>   drivers/raw/ioat/Makefile           |   1 +
>   drivers/raw/ioat/ioat_rawdev_test.c | 161 +++++++++++++++++++++++++-
>   drivers/raw/ioat/meson.build        |   2 +-
>   drivers/raw/ioat/rte_ioat_rawdev.h  | 169 +++++++++++++++++++++++++++-
>   5 files changed, 428 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/guides/rawdevs/ioat_rawdev.rst b/doc/guides/rawdevs/ioat_rawdev.rst
> index b908f31e0..22bb8a22c 100644
> --- a/doc/guides/rawdevs/ioat_rawdev.rst
> +++ b/doc/guides/rawdevs/ioat_rawdev.rst
> @@ -150,6 +150,106 @@ The following code shows how the device is configured in
>   Once configured, the device can then be made ready for use by calling the
>   ``rte_rawdev_start()`` API.
>   
> +Performing Data Copies
> +~~~~~~~~~~~~~~~~~~~~~~~
> +
> +To perform data copies using IOAT rawdev devices, the functions
> +``rte_ioat_enqueue_copy()`` and ``rte_ioat_do_copies()`` should be used.
> +Once copies have been completed, the completion will be reported back when
> +the application calls ``rte_ioat_completed_copies()``.
> +
> +The ``rte_ioat_enqueue_copy()`` function enqueues a single copy to the
> +device ring for copying at a later point. The parameters to that function
> +include the physical addresses of both the source and destination buffers,

Physical or IOVA?

> +as well as two "handles" to be returned to the user when the copy is
> +completed. These handles can be arbitrary values, but two are provided so
> +that the library can track handles for both source and destination on
> +behalf of the user, e.g. virtual addresses for the buffers, or mbuf
> +pointers if packet data is being copied.
> +
> +While the ``rte_ioat_enqueue_copy()`` function enqueues a copy operation on
> +the device ring, the copy will not actually be performed until after the

<snip>

> +	rte_mempool_free(pool);
>   	free(snames);
>   	free(stats);
>   	free(ids);
>   	return 0;
> +
> +err:
> +	rte_mempool_free(pool);
> +	free(snames);
> +	free(stats);
> +	free(ids);
> +	return -1;

The goto is added a commit too late :D

Otherwise, LGTM

Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly


More information about the dev mailing list