From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02hn0244.outbound.protection.outlook.com [104.47.36.244]) by dpdk.org (Postfix) with ESMTP id F138A1B2BF for ; Tue, 16 Jan 2018 16:40:38 +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=Y9zsObugNcn8hWwI4zRcOm06VGd98CvmrP5m8jkWuOdyFo4GXsm7wphARETc2XQdkdt7pGHhkj7I9Ir41G9djj1XIMGantiWGSCXSD7Ey5lwX7f8/0KfTJf34hRoIVfJBBRA6IwAetfb1Gtcdi5A0SC4Xa7Q8V7LZ/LVhq+S3CQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 15:40:35 +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: Tue, 16 Jan 2018 21:09:51 +0530 Message-Id: <20180116154003.3762-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR02CA0016.namprd02.prod.outlook.com (10.168.209.154) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0597772b-c61d-422d-77a9-08d55cf77dab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:Q50NeRBdp7kjNRxIWIvQay1/vy+Dtcz9qn3qIHfe+PidBKi68lhMl95vCnLogHjROgyyoaSNXbLjGrX7CeR07dEt29L8zR5qI4b0LG+TkSRUjHLWg0jv3Zv8phslUiFJbQn/1+qGr7O3XTiQ84B25MyHLb9dNoAi9h0iEJKGv/gTAeUSP4i3SPkH3iulY8siL6m1grxE+UblvUjixnrkbvLG1QJv14GQhWQ3/zGtIjhdIDDdxzFxLZDnpID/Vt9w; 25:8tqAzNZOesoWZQaW+pgYco0wRY+DllDgi0MSSVghbiQFUM6AciTRM29OzIfQBrtHJJ3UuCbnpKtP2y2VY80B/7DfA+W1kV7Nz8BESbTppS7hnL6ZfIRfn/1ke2A6RawgdSozbRquUo/jb2CKDtWF8RzSqBI2rUDgJFrniFfkqjGbIHAskGBwiUa/UVPyw+MDutczp/48oDHX8f2WL9nDkWSBhbJ2aZ1GCbYFbG5MoW68ZZ1rrn2RIIduyR14b8MWVsqfrtU203h5ad4UIuetO54L4avwtXwa+4x5iNuopPbcrxtWs2ZaSRvB/Al0eRu+Us4vOCsBw91ECfWatpFYOw==; 31:2ry3JIsndRCs0FJUfFor/bXl9FJkkPUXAta5xXtUYtOGwMQhYpLoW7MimvbBtSDqp1E8Cg3i1UniztCgYgliD35ha8Zd7EpW3W1n9r6LNNA72T4IEsL2EnqlWaZzPSp9Ty5hcw0iRghhfMDtpszDamoP6aq5qa0BSTjhSq2IjS08648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N X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(66839620246622); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(3231023)(2232001)(2102002)(944501161)(10201501046)(3002001)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(39860400002)(366004)(346002)(39380400002)(396003)(376002)(189003)(199004)(81166006)(97736004)(8676002)(6116002)(5009440100003)(52116002)(305945005)(8936002)(107886003)(1076002)(51416003)(81156014)(25786009)(8656006)(4326008)(50466002)(50226002)(6486002)(5660300001)(3846002)(7736002)(16526018)(68736007)(69596002)(42882006)(106356001)(26005)(76176011)(53936002)(6512007)(59450400001)(47776003)(48376002)(16586007)(386003)(6506007)(66066001)(72206003)(2950100002)(36756003)(2906002)(478600001)(105586002)(316002)(53416004)(6666003)(50929007)(42262002); DIR:OUT; SFP:1501; SCL:5; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:8BYQ9bf67qNqF/CoX/AoU+bx/D8Ftsi8O9DxIPAbV?= =?us-ascii?Q?m4xA6ZJH2vq2qoLYVBgre/6NULtxd0OOItVCIUJlAl+Yj27Fd28xj4f8N4eK?= =?us-ascii?Q?ed6lPyG9VdRSefSskkXl3QnQ8rnni205XzPO41LCqkfQVEXEQdDp6yI6Jjkf?= =?us-ascii?Q?YpaBKZvecZdlQuEkCLN6AwnaFa+vBT+FWeno1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ZVSoQZrEAj08bKGl362THKUuDtLjXJjAybKk8cUe+FU9nuE?= =?us-ascii?Q?MESW32ZRGRmp5vAAMF3A+FYslFCC6roKjUWYApWgLwtJMid/vBeEBoyfeXFR?= =?us-ascii?Q?Kq1X782oHNSMFDlDndAYvgbA2KOYCYULJDffOLJP17xBCCl4P7af4FH/3bN7?= =?us-ascii?Q?cobKaZgSsEohex9rLbUCYlQqcvt3U3VP5dox20v32f8rau/1HveC8y3vnntQ?= =?us-ascii?Q?XDDz6whp0qmzQqY4yL0Z6BXaKtQ1isYGnYAyZ6f94YC?= X-Microsoft-Antispam-Message-Info: sPhvS9ItrFyUdVhj/3tTBu2UB3fMe59txNTikhNIExICLUGqq8HjCkXYwnIkpnEwflaKFo4r5GjZE6C9C5CNaaTsC7zCWr0YsKezx3xoDJUuzivGftmM0+hMJVSr24U8 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 6:8Ul1dmoxsJL46jMyxUAduHoxcR/w459//ToSyolkLm7pEK+1tzY0pK7ghLke7uCOuN9KUH4eH8xEN0CgQVV8b366dI4G6jLW6UDds0fdRaFsqL2+Q31rVCDYFE9zAfsFl5t9gfcmqPleRox9EufvEdNnTP2x3HTy2mH92xy7PawSRr0JML/zbLzI2rb+xtJZN5IhHlyJVsSyrkKd9qsxLvD/UKkQQy/lNB5UimoT1NdlMdrZjPVyhwWgFC/JB3dHUKZflnJ6gAPYy7gVGQ6g/SB6dvUB7WSZxNcqhzhX7Pma4B6W+LM0cZ/7TCB4a6w0B+uYOPkP5dfnPVMuBAp00tesZwJf5au9zFHk78bdv04=; 5:LTBTxQn2Gtz3Q3Dt9vcbgU/3sfmZEFiQspJAgQcvbIryunhfGHW5JOSdmm562zyhfHhqYVZzJlSMiR4gscosMZ6TlyO2tC8PM6MD3UX92VSIJ3B02BtWC3dmrNWDkri8Knk0gigBvziyMQKA53+544/LUOMcSZ7nK6JYnIJsWQ4=; 24:YYQ5BSBicbuQK9vGHf3ESKxsO0qMOc9nc8eEVxlUMPI/Uyx11ZaNIWxo2cO835UUVSi6OFVdeHJnzhIXn6PsyA==; 7:GzDdfDsnKyWMJrm3mPnZjo83VIs2Ow+S/YLBSZOOjr/ag/9O/JxB8p4KSgUysti/w3pixf8S2j8ErtpvDZgTFM7+hung/XXYhX/iMob6FLsHfOrockOaG+7RkHsK2UMPqBZju4wPVXoty2QPswUpjCPMMBdp2jvlJC79onQ+sj+1xbuCiuxnV0phDOc4cUrWJUTOfuWv3PNCqCOutV2aYZuVr1ErY62M5Ujith6ksAIB0i3/A5rsf0vbuZX8b+Bh SpamDiagnosticOutput: 1:22 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:40:35.1766 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0597772b-c61d-422d-77a9-08d55cf77dab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v6 02/14] 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: Tue, 16 Jan 2018 15:40:39 -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