[dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test

Jerin Jacob jerin.jacob at caviumnetworks.com
Mon May 7 12:08:34 CEST 2018


-----Original Message-----
> Date: Sun, 6 May 2018 00:17:09 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar at intel.com>
> To: jerin.jacob at caviumnetworks.com, hemant.agrawal at nxp.com,
>  akhil.goyal at nxp.com, dev at dpdk.org
> CC: narender.vangati at intel.com, abhinandan.gujjar at intel.com,
>  nikhil.rao at intel.com, gage.eads at intel.com
> Subject: [v3,4/5] test: add event crypto adapter auto-test
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar at intel.com>
> ---
> +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,
> +	.sub_event_type = 0,
> +	.event_type = 0,
> +	.priority = 0,
> +	.impl_opaque = 0
> +};

This may break old compiler.
see http://dpdk.org/dev/patchwork/patch/39398/

> +
> +struct rte_event_crypto_request request_info = {
> +	.cdev_id = TEST_CDEV_ID,
> +	.queue_pair_id = TEST_CDEV_QP_ID
> +};
> +
> +static int
> +test_crypto_adapter_stats(void)
> +{
> +	struct rte_event_crypto_adapter_stats stats;
> +
> +	rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats);
> +	printf(" +------------------------------------------------------+\n");
> +	printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID);
> +	printf(" + Event port poll count          %lu\n",
> +		stats.event_poll_count);
> +	printf(" + Event dequeue count            %lu\n",
> +		stats.event_deq_count);
> +	printf(" + Cryptodev enqueue count        %lu\n",
> +		stats.crypto_enq_count);
> +	printf(" + Cryptodev enqueue failed count %lu\n",
> +		stats.crypto_enq_fail);
> +	printf(" + Cryptodev dequeue count        %lu\n",
> +		stats.crypto_deq_count);
> +	printf(" + Event enqueue count            %lu\n",
> +		stats.event_enq_count);
> +	printf(" + Event enqueue retry count      %lu\n",
> +		stats.event_enq_retry_count);
> +	printf(" + Event enqueue fail count       %lu\n",

Use PRIx64 to fix issue with 32b build target.

> +		stats.event_enq_fail_count);
> +	printf(" +------------------------------------------------------+\n");
> +
> +	rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID);
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +configure_eventdev(void)
> +{
> +	const char *eventdev_name = "event_sw0";
> +	struct rte_event_queue_conf queue_conf;
> +	struct rte_event_dev_config devconf;
> +	struct rte_event_dev_info info;
> +	uint32_t queue_count;
> +	uint32_t port_count;
> +	int ret;
> +	uint8_t qid;
> +
> +	evdev = rte_event_dev_get_dev_id(eventdev_name);

No need to assume it is "event_sw0" driver. You can select 0th event
device for testing. If none of the event device is available then you can 
create "event_sw0" with vdev.

> +	if (evdev < 0) {
> +		if (rte_vdev_init(eventdev_name, NULL) < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error creating eventdev\n");
> +			return TEST_FAILED;
> +		}
> +		evdev = rte_event_dev_get_dev_id(eventdev_name);
> +		if (evdev < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
> +	ret = rte_event_dev_info_get(evdev, &info);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n");
> +
> +static struct unit_test_suite service_tests  = {

It is not "service_tests". Choose an appropriate name.



More information about the dev mailing list