From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02hn0241.outbound.protection.outlook.com [104.47.37.241]) by dpdk.org (Postfix) with ESMTP id E62557CF1 for ; Mon, 18 Dec 2017 22:44:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RlZU1KlGCr9NehcNo5DHax57bJ7+laWtXzhFwkj8P98=; b=kCGz8eyzFxWi3ieoe4ly7vX9yoXjXKXFGe83dq5uAMyKi0bbCNLuSnnC3YTntXQTmaRTWeWHwkAqxEjSJ+uQn/fYnuxD9JhLvKzgDgiOXl06t/5AOd+mmciXMmIGHBt9Q10iW4Wg/xczvj2Zp3v+zRdyIrMeVJs3dB3lXb+EM7E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Mon, 18 Dec 2017 21:44:48 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 19 Dec 2017 03:13:55 +0530 Message-Id: <20171218214405.26763-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0163.apcprd02.prod.outlook.com (10.171.30.23) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06f25ccd-64c5-418f-c310-08d546609214 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:FXBE0EJk4njE7Cv/DeZR0x73dYbmvObI8j4zvUYwNkeEheZnLTvoN21fwFiHUyaLtpayQxjDDKFdoXPrMNzQYhyUxkmSoi71FI/G/kvuLz8CAZVMpt/knBQK1MfyQ1UV3zmido5eH20bCEda2st14qFOQBmNhEeHOesghqCsh10LHkhNgQ6ceaSjNBrgnyG5/8KoJlgCQkXIoyckmd/dp6y1YiA9K6FH6Xm/1TBnoMW8CfgW9TPCnYqSX7hnZXpV; 25:Vzt75elyr+JiJ8D/nJhIu5o4dM0/pVmB3oAgrpc+JNTy7FVQ6/mYKpiWZy+K3G2sm+u2zWg3JOJZvP5Um7lcxDAfwVb8SBIcRuOXRdOf9FAPCjpOarr2R5gVXXbuXRwAJh8PMgLV8JJKrUIF9zIJMkSy016z//G+JqmhmVq2A1PDT24XkpUTAV1F0mKh06mgQa8iOJ9U/82SSzFYP9gvzHusQJOMpoD0Ln1KkBcM2YdBBjj2YFbB3uzgtcaG5H3l+1/8Ji2+kE7mqztPrbKx5/UUFqRfCyIrvduiwcCqK8tFvrUO2VQ4MM6MFj066pyx+g5J9xtEyOZjVNV/2cpLCQ==; 31:You/dZ02XsUoAzVT+VUFvoDuy0tICc4BpIWcTXoZFGauBUb7qFLFcj/bI6jQG2OaEfCdPdRC8HUYJXM9a0f7lys/wMNaV9TISI92u0tVYeSCqVv5A0v1Nm0kOelmBKm5xlyNv+dzWxgEMV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yd8diIN0rPIl1hKkmDJnd1gDN+p X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(66839620246622); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231023)(2102001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0525BB0ADF X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(4326008)(2906002)(53936002)(305945005)(25786009)(1076002)(8936002)(50226002)(16526018)(6506007)(386003)(68736007)(52116002)(478600001)(51416003)(48376002)(5009440100003)(3846002)(6116002)(72206003)(36756003)(6486002)(107886003)(8676002)(5660300001)(106356001)(105586002)(8656006)(2950100002)(42882006)(6512007)(6666003)(59450400001)(16586007)(7736002)(66066001)(47776003)(76176011)(50466002)(81166006)(81156014)(316002)(97736004)(50929007)(42262002); DIR:OUT; SFP:1501; SCL:5; SRVR:DM5PR07MB3467; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3467; 23:u9m6kOQ5/E90GFzy12jKYV7kk+sNRu70MeeNTwMus?= =?us-ascii?Q?o5AcTH9D1eanlKdy+hvw/e29kDLoq3uvh92cRIj/G616EsDPSV45XtPVw453?= =?us-ascii?Q?HR58U3aN78Q2z1ljCoIl5Y5Wb80cFADF22/4gQyKHIwHskygV6kpO/Iqa7jH?= =?us-ascii?Q?uz3DhZqtNIPmlvAE58j970Yfgrgupmldns5duyH4J+PlYiXBxKbmelQK2D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pMtKQYx8h+jnJ15U12Ox+1CrcpzXP2BqvB6glC7E1+XBSLYLYjZsZydZryMfKqqZWk8n/Myp4RGyQy7tyRXVk4Rpd7NPh SpamDiagnosticOutput: 1:22 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2017 21:44:48.9278 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06f25ccd-64c5-418f-c310-08d546609214 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH v2 02/12] app/eventdev: add pipeline test setup and destroy 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: , X-List-Received-Date: Mon, 18 Dec 2017 21:44:54 -0000 Pipeline test has the queue and all types queue variants. Introduce test_pipeline_common* to share the common code between those tests. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/Makefile | 2 + app/test-eventdev/test_pipeline_common.c | 71 +++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 84 ++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 app/test-eventdev/test_pipeline_common.c create mode 100644 app/test-eventdev/test_pipeline_common.h diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index dcb2ac476..f2fb665d8 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -51,4 +51,6 @@ SRCS-y += test_perf_common.c SRCS-y += test_perf_queue.c SRCS-y += test_perf_atq.c +SRCS-y += test_pipeline_common.c + include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c new file mode 100644 index 000000000..6e9088719 --- /dev/null +++ b/app/test-eventdev/test_pipeline_common.c @@ -0,0 +1,71 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium, Inc 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium, Inc nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "test_pipeline_common.h" + +int +pipeline_test_setup(struct evt_test *test, struct evt_options *opt) +{ + void *test_pipeline; + + test_pipeline = rte_zmalloc_socket(test->name, + sizeof(struct test_pipeline), RTE_CACHE_LINE_SIZE, + opt->socket_id); + if (test_pipeline == NULL) { + evt_err("failed to allocate test_pipeline memory"); + goto nomem; + } + test->test_priv = test_pipeline; + + struct test_pipeline *t = evt_test_priv(test); + + t->nb_workers = evt_nr_active_lcores(opt->wlcores); + t->outstand_pkts = opt->nb_pkts * evt_nr_active_lcores(opt->wlcores); + t->done = false; + t->nb_flows = opt->nb_flows; + t->result = EVT_TEST_FAILED; + t->opt = opt; + opt->prod_type = EVT_PROD_TYPE_ETH_RX_ADPTR; + memcpy(t->sched_type_list, opt->sched_type_list, + sizeof(opt->sched_type_list)); + return 0; +nomem: + return -ENOMEM; +} + +void +pipeline_test_destroy(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + + rte_free(test->test_priv); +} diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h new file mode 100644 index 000000000..f87d02d6b --- /dev/null +++ b/app/test-eventdev/test_pipeline_common.h @@ -0,0 +1,84 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium, Inc 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium, Inc nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _TEST_PIPELINE_COMMON_ +#define _TEST_PIPELINE_COMMON_ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "evt_common.h" +#include "evt_options.h" +#include "evt_test.h" + +struct test_pipeline; + +struct worker_data { + uint64_t processed_pkts; + uint8_t dev_id; + uint8_t port_id; + struct test_pipeline *t; +} __rte_cache_aligned; + +struct test_pipeline { + /* Don't change the offset of "done". Signal handler use this memory + * to terminate all lcores work. + */ + int done; + uint8_t nb_workers; + uint8_t mt_unsafe; + enum evt_test_result result; + uint32_t nb_flows; + uint64_t outstand_pkts; + struct rte_mempool *pool; + struct worker_data worker[EVT_MAX_PORTS]; + struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS]; + rte_spinlock_t tx_lk[RTE_MAX_ETHPORTS]; + struct evt_options *opt; + uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; +} __rte_cache_aligned; + +int pipeline_test_setup(struct evt_test *test, struct evt_options *opt); +void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt); + +#endif /* _TEST_PIPELINE_COMMON_ */ -- 2.14.1