From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0041.outbound.protection.outlook.com [104.47.37.41]) by dpdk.org (Postfix) with ESMTP id 0F4781B31F for ; Tue, 16 Jan 2018 18:47:26 +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=No5gz2eTkvkwmMkgeg3AXNTxh0QbBvBzZHdlU/Xqz87FGpFuscxhspdwDsSMQKgsb05YHybxxm+3bZvrEhYpNaVbmpsYsU61hZXVVncyYSMSni3Q8rK0L0jQE/lXitE6jBsATXT7VzRvf0Eru27ITpFF7ptuzs/aFmBiDUQkYzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (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 17:47:18 +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 23:15:54 +0530 Message-Id: <20180116174607.10821-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116174607.10821-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116174607.10821-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0158.apcprd02.prod.outlook.com (10.171.30.18) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dea1b37a-fa03-4a77-ba16-08d55d093452 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:xK5eT7JXWeGn/c4XjVsJy+QsQzuEpx3/+dlzyqPrK6dqSaG++TIWTpxYWFsjcAIbcKR3cRI1eLgJdIYdOMX0MI1p+BSCXwYqt9durvDoQatSrB5aqoizTlzpqk9z9VyCBpzfmVCo8yYGITGcGqPUCC6tjUJGkkjjC+DeXHoI7mL6XRSrhb3BXGy5KaUU0xhS1gVddfEnYjE2XwDgyik2JIHc5Y6oj/Q7pZvdA3iWPynqZ7Lf7vqx+WZ4LXWjRenj; 25:ipWniTY/O8gG+bdq+ozhxOvxEB4BwSK41wbD+EtFnHm5qVkIz5Vr5S9rQNsXqK6x6tZC6sJ1ZbP3cGzgJDUQ+e990l6HvR7QQnCodO3buUOulI51a08fNmSJgmHGP1ho5clwScIS+D3ihBCpSxp/+P4St2PjF+B5NUYccc+7OhRe5p1QXvz8e5zwaIfMogbW3Sg1ukH5PvCVMDamg3j4FnepqQimLip/wo85jqZFd8MrHx103D7LgoQ8t4LTIZuE8RpfGM2bfqWFo0D9y6lPGc4NoZR4xE7GWNm6aMiNNVwJ1v4csQGUvy4whODVOxZtuNyIaFHrt2IAQMkBT0eBkg==; 31:RMv1VSgcDoFqjtZS1eDkXPp+wWZN90xIqMfnJXheymMMw7jO4axZ/JpFjpjqXWLYSojqK9fnhf3YQRU2ilrKt1hz3RJ7FzzGjHmwB8sIik48yUcsa7KdUGNCp7213tm5LycExSBMvEkcX7wYXcmBCy/OveVBpBj2ZD/wiSDbCICGO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-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501161)(93006095)(3002001)(10201501046)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(39860400002)(376002)(39380400002)(396003)(189003)(199004)(81166006)(97736004)(8676002)(6116002)(5009440100003)(52116002)(305945005)(8936002)(107886003)(1076002)(51416003)(81156014)(25786009)(8656006)(4326008)(50466002)(6486002)(5660300001)(3846002)(7736002)(50226002)(16526018)(68736007)(106356001)(26005)(76176011)(53936002)(6512007)(59450400001)(47776003)(48376002)(16586007)(386003)(6506007)(66066001)(72206003)(2950100002)(36756003)(2906002)(105586002)(478600001)(316002)(6666003)(42882006)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:localhost.localdomain; 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:xLhUHHw7KFharTv745uYZydq7Ab4KAuYz8YtWFGOG?= =?us-ascii?Q?Ea/a3MvBFck66c7WhD5o4MGshOMC89CJ5NS5WsGkyhwqkC2/6nqYapB9AaFQ?= =?us-ascii?Q?7LYSpkzw2Wzos4eCt6LQk226k2gSHOmn0f0YaxS01lL7xBCrQkedqG/SXGxQ?= =?us-ascii?Q?Rrww01q7I8OfErXTbi1z0RE91UOLCmOdFxMugRHXiWAAkHBAa2cVJ66KAihQ?= =?us-ascii?Q?rzkeJoXOoc4jXAogP/QdcmLN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lRC5hrMQP9MbaTkOIeeUWU1Fo7VFkTJYtnbdMfORM/CE7+PFw1XvzBTgI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 17:47:18.7187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dea1b37a-fa03-4a77-ba16-08d55d093452 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 v7 02/15] 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 17:47:27 -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