From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: Re: [v2,4/6] test: add event crypto adapter auto-test Date: Wed, 25 Apr 2018 20:10:16 +0530 Message-ID: <4750e560-5c72-8f1d-ac8e-99af53f5bc20@nxp.com> References: <1524573807-168522-1-git-send-email-abhinandan.gujjar@intel.com> <1524573807-168522-5-git-send-email-abhinandan.gujjar@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com To: Abhinandan Gujjar , jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id 52E687CF8 for ; Wed, 25 Apr 2018 16:40:37 +0200 (CEST) In-Reply-To: <1524573807-168522-5-git-send-email-abhinandan.gujjar@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Abhinandan, On 4/24/2018 6:13 PM, Abhinandan Gujjar wrote: > Signed-off-by: Abhinandan Gujjar > --- > 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#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