From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [v3,4/5] test: add event crypto adapter auto-test Date: Mon, 7 May 2018 15:38:34 +0530 Message-ID: <20180507100833.GA7848@jerin> References: <1525546030-11204-1-git-send-email-abhinandan.gujjar@intel.com> <1525546030-11204-5-git-send-email-abhinandan.gujjar@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org, narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com To: Abhinandan Gujjar Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0067.outbound.protection.outlook.com [104.47.42.67]) by dpdk.org (Postfix) with ESMTP id 2E3121D7 for ; Mon, 7 May 2018 12:08:55 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1525546030-11204-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" -----Original Message----- > Date: Sun, 6 May 2018 00:17:09 +0530 > From: Abhinandan Gujjar > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, > akhil.goyal@nxp.com, dev@dpdk.org > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com, > nikhil.rao@intel.com, gage.eads@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 > --- > +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.