[dpdk-dev] [v2,4/6] test: add event crypto adapter auto-test

Akhil Goyal akhil.goyal at nxp.com
Wed Apr 25 16:40:16 CEST 2018


Hi Abhinandan,
On 4/24/2018 6:13 PM, Abhinandan Gujjar wrote:
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar at intel.com>
> ---
>  test/test/Makefile                    |   1 +
>  test/test/test_event_crypto_adapter.c | 915 ++++++++++++++++++++++++++++++++++
>  2 files changed, 916 insertions(+)
>  create mode 100644 test/test/test_event_crypto_adapter.c
>
> diff --git a/test/test/Makefile b/test/test/Makefile
> index c9c007c9..3200daa 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -186,6 +186,7 @@ SRCS-y += test_eventdev.c
>  SRCS-y += test_event_ring.c
>  SRCS-y += test_event_eth_rx_adapter.c
>  SRCS-y += test_event_timer_adapter.c
> +SRCS-y += test_event_crypto_adapter.c
>  endif
>
>  ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y)
> diff --git a/test/test/test_event_crypto_adapter.c b/test/test/test_event_crypto_adapter.c
> new file mode 100644
> index 0000000..ea13e3b
> --- /dev/null
> +++ b/test/test/test_event_crypto_adapter.c
> @@ -0,0 +1,915 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2018 Intel Corporation
> + */
> +
> +#include <string.h>
> +#include <rte_common.h>
> +#include <rte_mempool.h>
> +#include <rte_mbuf.h>
> +#include <rte_cryptodev.h>
> +#include <rte_eventdev.h>
> +#include <rte_bus_vdev.h>
> +#include <rte_service.h>
> +#include <rte_event_crypto_adapter.h>
> +#include "test.h"
> +
> +#define PKT_TRACE                  0
> +#define NUM                        1
> +#define DEFAULT_NUM_XFORMS        (2)
> +#define NUM_MBUFS                 (8191)
> +#define MBUF_CACHE_SIZE           (256)
> +#define MAXIMUM_IV_LENGTH         (16)
> +#define DEFAULT_NUM_OPS_INFLIGHT  (128)
> +#define TEST_APP_PORT_ID           0
> +#define TEST_APP_EV_QUEUE_ID       0
> +#define TEST_CRYPTO_EV_QUEUE_ID    1
> +#define TEST_ADAPTER_ID            0
> +#define TEST_CDEV_ID               0
> +#define TEST_CDEV_QP_ID            0
> +#define PACKET_LENGTH              64
> +#define NB_TEST_PORTS              1
> +#define NB_TEST_QUEUES             2
> +#define CRYPTODEV_NAME_NULL_PMD    crypto_null
I think the supported cryptodevs should be more than just null
It should be done similar to other test and example applications.
> +
> +#define MBUF_SIZE              (sizeof(struct rte_mbuf) + \
> +				RTE_PKTMBUF_HEADROOM + PACKET_LENGTH)
> +#define IV_OFFSET              (sizeof(struct rte_crypto_op) + \
> +				sizeof(struct rte_crypto_sym_op) + \
> +				DEFAULT_NUM_XFORMS * \
> +				sizeof(struct rte_crypto_sym_xform))
> +
> +
> +static const uint8_t text_64B[] = {
> +	0x05, 0x15, 0x77, 0x32, 0xc9, 0x66, 0x91, 0x50,
> +	0x93, 0x9f, 0xbb, 0x4e, 0x2e, 0x5a, 0x02, 0xd0,
> +	0x2d, 0x9d, 0x31, 0x5d, 0xc8, 0x9e, 0x86, 0x36,
> +	0x54, 0x5c, 0x50, 0xe8, 0x75, 0x54, 0x74, 0x5e,
> +	0xd5, 0xa2, 0x84, 0x21, 0x2d, 0xc5, 0xf8, 0x1c,
> +	0x55, 0x1a, 0xba, 0x91, 0xce, 0xb5, 0xa3, 0x1e,
> +	0x31, 0xbf, 0xe9, 0xa1, 0x97, 0x5c, 0x2b, 0xd6,
> +	0x57, 0xa5, 0x9f, 0xab, 0xbd, 0xb0, 0x9b, 0x9c
> +};
> +
> +struct event_crypto_adapter_test_params {
> +	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *op_mpool;
> +	struct rte_mempool *session_mpool;
> +	struct rte_cryptodev_config *config;
> +	uint8_t crypto_event_port_id;
> +};
> +
> +struct rte_event response_info = {
> +	.queue_id = TEST_APP_EV_QUEUE_ID,
> +	.sched_type = RTE_SCHED_TYPE_ATOMIC,
> +	.flow_id = 0xAABB,
I believe all fields shall be filled here. In some GCC version it will 
give warning.
> +};
> +
> +struct rte_event_crypto_request request_info = {
> +	.cdev_id = TEST_CDEV_ID,
> +	.queue_pair_id = TEST_CDEV_QP_ID
> +};
> +
> +static struct event_crypto_adapter_test_params params;
> +static uint8_t crypto_adapter_setup_done;
> +static uint32_t slcore_id;
> +static int evdev;
> +

Regards,
Akhil


More information about the dev mailing list