From patchwork Tue Oct 1 11:33:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 174838 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8416043ill; Tue, 1 Oct 2019 04:36:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWWZZXRGgT38lnxR4E87Y/cUAId07Cj7obmO48HgZgZH/N++WNLEUbcizOwnO4GbFYPCvd X-Received: by 2002:a17:906:4e57:: with SMTP id g23mr13743995ejw.264.1569929797438; Tue, 01 Oct 2019 04:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569929797; cv=none; d=google.com; s=arc-20160816; b=cX+vxWjiT1Y1+CfRAZjt10Th40ljDTL/BIhqrivTfs5tdmTaphYtKwNKiGng8qKY/T zSDT7NuUs1/tj8l+dEXRLst4bWDOq8cHud1Un02nFNkDW6ruee+Rt37DP03lggdMOcfC xNgMz9oqlXDo/SRrfnec8amt/rUhV/8cBAWhF2AEu7LbyNEc2baE8JGrQCBduxDDKaCZ MHvOtYkUlPGVogxHVIviS2uDdR88ZOMg+xTjHgjkt3gQ6wydCr69FP5m36f/0Taq0kLj WN6R/BN+x/opezlp5f9psJsNGjeBvy+S9KR3Sn0BXdsPLDQt4LZBganph+VZOzh5N1FW BMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=5IHr9mo368oC9ipCe/i4blD85HkZ0lnEjEJSK8ga3A8=; b=wzPM46gogZdkXa0kVz5XlrYHKkKtDsC+PMNZzk4D4cskGOg83MFZ06LJyfNtrXPoyR Pa2moo+3qI1i4sIrmGUV+O6Uu167tOJXtwnkLcie9VipLkS+LZv5SlBrJF1y+94BAv3I d4cCQzNRilZWWRG79FUBi3BHUNco458JLUOODyy/dDixSgBFizHYS0Ay1u/2Q2EkkWSs 2jNwSO4UXMCoRlpOE9CtwB0cP4ZxNQ0/+wHpDRRaVKhh4SZQF8+TQNV9VYrSJWcP0Bc9 GQjwJ0uVMHOKRUerduRrtvB3OeoNix52GuhwDwF6B3Mb7FS608XfKoiXgtIz2/PSo5QS F4aQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id gg17si8417068ejb.294.2019.10.01.04.36.37; Tue, 01 Oct 2019 04:36:37 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 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,