From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0081.outbound.protection.outlook.com [104.47.38.81]) by dpdk.org (Postfix) with ESMTP id 793CE1322C for ; Fri, 12 Jan 2018 17:44:52 +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=cavO6PhoCzBOGz3AvbD+HYXmMlWPFtTsIih/vUVLNtM=; b=bXUXbj6NK0tzm10o4G2JKaEybahgoaHX6PbSaxhrQ31P7iD8sp42xkvlujs743PxBPLAJey5oQ7khRLTtwdU+iOlmjOyJZczYW7V2+i0Z1nH3b+ZD5qC2hqAwFCX1IxjNFC/2L2x2pzwtLT0XTES1X26dinujFCd9Yx90lkaBJA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (119.82.125.132) by DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 12 Jan 2018 16:44:45 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.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: Fri, 12 Jan 2018 22:14:05 +0530 Message-Id: <20180112164416.21374-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180112164416.21374-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180112164416.21374-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [119.82.125.132] X-ClientProxiedBy: YQXPR0101CA0023.CANPRD01.PROD.OUTLOOK.COM (52.132.74.164) To DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c738a5ee-947a-45a5-01bd-08d559dbcb3d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020084)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3465; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 3:PRUl8od3i81d8xNxNXBtu9ZO5EetzGBvdQgWB+RjZeVCwo3gg2aAcO4IFKe9K1ZSeb8zx1s3C3hjndK2sp3k6PzylpXqsZM0WeHmr2L7/vzmAtXdY1wk8z+FSX5CKc2xnG9gii6R7671QZGo+rCb790neipo6Oi8tkdW8oRRquyNc9Je7FLyTlvMwAncv2978E+t4Ddzk4dodVE2Sa32uTfKDRIVj9gA1YXnfsTgqguna/DJX5xtWQWqTJCivjVv; 25:bNMIWwBPIg3twyjvQruOLNpc3Qz4sQk9bL8Z2VmP7IyXcjjR5QORe1P99bbfkrL7nxPJbw+pVzzJ/Syr4k4gcRA4+6Loj+zJdBSf/WtU8DLXiW0WelCQNiKNHfshu0cGSI8p5bTAGkAFYlE3HDFGf+YYbGBOnM5VjBJVl2d/yKc028TM4ZJITfyInMaI6tNipieMDxVbZucg+0Nj0uXerHy9imo3sahv5pOIW9NmUqtv32Q4umwr1VSYz8ntUq6HFrCd+KsvcClQo/MNUuEUJwIymsWf/u5OZ3PEzM2oC+5XVWiAp63xowfeDpdd/bJPySFo4tms+vEUC9fmLJSGjQ==; 31:+UBxEn1YJ3ATJh7dQH3Al+UcRJawFwPEJ1NJNaswOTX42CydFe8Is2LuXqzkrWFXm7NRJcOQ+q0eiyRtzX/U18P3OZq/o5c7VSjFQJer2HdIffaMnIvHxFwFXb1ddXpoFynNFC+JsMPfPhvCWtuHS6lyPK7h3DXuLKr4Ce/MQMe14mkJLuPHnIuKK7PkpKWtVCKHHY+puZRyt4hQogxHhbf7wI7aigk2kpLmgfU6Iu4= X-MS-TrafficTypeDiagnostic: DM5PR07MB3465: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 20:t0BruJZQ1TnUZrhejHRCLu6AaoueS7smd79Yag21YvvRFxQuoEPbg2YaeDV5oRLq4L6G35FkwB+XbG7egC2V4dL+P8JDO5RZqLiQLQpmUVPR8x+L105Lr7bLWM62D1uV3ehBuazgXtKBiybO/ko0r+AZ1JRf4v2hddW+1/Ilz0S2dnsrqkggux5SLLP3dBCNfv12X+O8Gny+fhAgyv0kZ6wtLqO/8JURFsfQU34sLdpS7EC3s0AVbJxqzKhidDy9+7eZcj+2lBgXWYwaSogekoNQhB+VqwTAkQjQc9ij/DH6CCywtsL7mH4MAANF8LV+F6ALxKE5Fj6zQuw6nMlex63e8gSsHB1h/raDJQtBhuSani1nmu/uqaxPhL+1bHPf7Dto/EZvVtWhu8kDDD2wuoYkawmVPj1JER++3YmkGXp0jtA6GeP1vYAmP5GMAEJohslXyHttaW8QlKbJOWKBeBBnFVRYC5cMMgxCMJtMUyXT/CGHNmS1njPrk/4gyifdDlDGIwfweHznGQL+kBMhWA02uoVR37p+jzPi605EOptszWERSpud8jd0SAA2qL/gOFS3Xr0ctC2PhhDVn3UglacvivNEgxWkMXNYMU2jV78=; 4:SH8m3fRVZmeVYhbPGfFXwhlCdzSnGaanettcyBe3llDmnPjM9AloX64ysFRJoi+nvR5Vq45vAQwmAj4/hRStQM2vTixFeVD8aYzM0Jy1ZHfXaC8r8BMF3Tp8qApJ5cKmUd9NOO3VFO7ABkqx+yo/a06YC/w5zbV8zL2Pk9yLNwIrIVxCQOzYpdRPeSxCXFw08IprTjFW4Q+Kqt20JAIV1i3VMZrXaEOZdFPht08trnBTN3aPE3xtofOBtXF9htDqnZ8ztAROiaf+AWmVWqwP3Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(3231023)(944501145)(6041268)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR07MB3465; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3465; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(39380400002)(376002)(396003)(366004)(189003)(199004)(50226002)(76176011)(8676002)(6666003)(316002)(48376002)(53416004)(81156014)(53936002)(69596002)(16586007)(81166006)(59450400001)(386003)(16526018)(52116002)(6506007)(51416003)(1076002)(6486002)(2950100002)(105586002)(66066001)(6512007)(50466002)(106356001)(47776003)(4326008)(5660300001)(3846002)(42882006)(6116002)(7736002)(68736007)(97736004)(8656006)(478600001)(107886003)(8936002)(72206003)(36756003)(2906002)(305945005)(25786009)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3465; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DM5PR07MB3465; 23:LfZHQFTyCNqrArtqz/yuimMw+NaBIewCvN9UGRGAv?= =?us-ascii?Q?MU0761Lg5A0WB6kDBi2DOOYcGf1nIg85ciJ0Skv7FRG9VzdSZCXFSOAE2kQl?= =?us-ascii?Q?joQCBJ/wTBfAZsK0BISoJp1P8dQI/AJuUbY5c+n0nOBS5Uex/VU9indVVnw7?= =?us-ascii?Q?+tt8gLPAxEU/zX54MFMpDxlKAsCA9r7yPS/tKc8aamz5vYsS+l//H6P5/1Dk?= =?us-ascii?Q?Eu7zhUb+ZurcgisADbE/Y6t5WH9L454bf7jbsgU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xyDx7RogtVzQFl2Oj91u4+PJLihOpfX13ZN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 16:44:45.4338 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c738a5ee-947a-45a5-01bd-08d559dbcb3d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3465 Subject: [dpdk-dev] [PATCH v4 02/13] 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: Fri, 12 Jan 2018 16:44:52 -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 Acked-by: Jerin Jacob --- app/test-eventdev/Makefile | 2 ++ app/test-eventdev/test_pipeline_common.c | 44 ++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 57 ++++++++++++++++++++++++++++++++ 3 files changed, 103 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 cfe567a6d..1707318f2 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -25,4 +25,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..aa3481247 --- /dev/null +++ b/app/test-eventdev/test_pipeline_common.c @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017 Cavium, Inc. + */ + +#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..645571cf5 --- /dev/null +++ b/app/test-eventdev/test_pipeline_common.h @@ -0,0 +1,57 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017 Cavium, Inc. + */ + +#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