From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E8CBA2EDB for ; Tue, 1 Oct 2019 13:36:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 013D01BE0C; Tue, 1 Oct 2019 13:36:14 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id C53AF4C99 for ; Tue, 1 Oct 2019 13:36:10 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A3CB91A094E; Tue, 1 Oct 2019 13:36:10 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D76D21A0567; Tue, 1 Oct 2019 13:36:08 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id ED7EC4032B; Tue, 1 Oct 2019 19:36:03 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerinj@marvell.com, abhinandan.gujjar@intel.com Date: Tue, 1 Oct 2019 17:03:38 +0530 Message-Id: <20191001113339.21767-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191001113339.21767-1-hemant.agrawal@nxp.com> References: <20191001113339.21767-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/6] test/event_crypto: use device cap instead of fixed values X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Instead of hardcoded event device capabilities, it is better to enquire and use the device supported caps. Signed-off-by: Hemant Agrawal --- app/test/test_event_crypto_adapter.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index b9e3a439e..6b10909e3 100644 --- a/app/test/test_event_crypto_adapter.c +++ b/app/test/test_event_crypto_adapter.c @@ -703,12 +703,11 @@ test_crypto_adapter_free(void) static int test_crypto_adapter_create(void) { - struct rte_event_port_conf conf = { - .dequeue_depth = 8, - .enqueue_depth = 8, - .new_event_threshold = 1200, - }; int ret; + struct rte_event_port_conf conf; + + ret = rte_event_port_default_conf_get(TEST_CDEV_ID, 0, &conf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); /* Create adapter with default port creation callback */ ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID, @@ -747,14 +746,12 @@ test_crypto_adapter_qp_add_del(void) static int configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode) { - struct rte_event_port_conf conf = { - .dequeue_depth = 8, - .enqueue_depth = 8, - .new_event_threshold = 1200, - }; - uint32_t cap; int ret; + struct rte_event_port_conf conf; + + ret = rte_event_port_default_conf_get(TEST_CDEV_ID, 0, &conf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); /* Create adapter with default port creation callback */ ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID, -- 2.17.1