From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03hn0212.outbound.protection.outlook.com [104.47.41.212]) by dpdk.org (Postfix) with ESMTP id BC71F1B1DA for ; Tue, 16 Jan 2018 16:18:21 +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=Z4G7m65LSBQJVqH83BtlLr1AtMD9Z0mqqJbzERrth5IIYBW0dXWtvfmAJNnxMsIijvDbNNhIw54a7STlDFfoOqd0ylEHX/s48k2EQHFtUb3+69SFYyvW8fnK6xN3WQeJHhACYormEAc+WSMkIXWHIQqHHdU/T7O5KAp1wSWIoTI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) 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:18:17 +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 20:47:17 +0530 Message-Id: <20180116151728.566-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116151728.566-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116151728.566-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR21CA0059.namprd21.prod.outlook.com (10.172.93.149) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43e6dfe5-4a05-4e68-ad72-08d55cf46028 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:Um/+ACLY/UsBcCR7ZHdqb+lU9r9QzOfr5mi0kbQQhB6FmETfFyYeGN+Ke/HQY8Gg0UBDXS3X0s92EDN7zIYndXQuGXcYi9vuBpimFSZqRkaIcHaAiGuaI3X9ZvOirevlfaEm+jKwDOJJe5CMbpWfwLtJhzQnj8PjbbyhX3cG7DwR8gzQ9LfZhWPG9bLkCqut5utxmGX3YO0NCIG+KU+vtCklqcpiwGNA2TzetDiiB+FgMuwVZUjFm3LH1IQpcURk; 25:QKRulyXif+EviLG1sYG0d0tMpCQ8OJSq4guQ3xvThcYbnS4k8wG1JR8OBsH9unoF+KBPoNhvySfEUw+wP6dsR/JlilPDXSsVASN7SHjBhv6zHhJ6bVaVT7GrYF1FGhcAZ/qlV4htfmogvawLixHGBKAeARmzFSgWXUMmfNVXPSqD6vxvMukmi/MBiB94boJL+9Xji+b8RLlQw/PmvcVRz5NmPpEWl5g4LBCkDaH7c7I4jLix8tSR0j1tIJENhsqWKIuZyJQaW50a4QEPmpIpP6i+A4kwBAr429q5uNlNHkagu8pZfR4tbJmT+uJZgnqA4vL8TUK1ek4tsam3LHK3Gw==; 31:NRrYzjCvI+1qjyRCdmwGx+sBTGtvA4pE7BF6vObiVf5ySPvOGyFcKORgr4L2abN9vxN7U7u5eQFislebfHBMd3lXg8H3zmZ4gbf5ey6C2tEJG+gPvHsFoUpj8gqYydHU5LltCYiKfYPzqBu3f7fKRjR8z1RwiUSj5xdq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yjpD X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(66839620246622); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(2232001)(2102002)(944501161)(93006095)(10201501046)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(366004)(396003)(346002)(376002)(39380400002)(39860400002)(199004)(189003)(2950100002)(4326008)(42882006)(5009440100003)(107886003)(25786009)(68736007)(16526018)(72206003)(478600001)(316002)(5660300001)(16586007)(26005)(50226002)(53936002)(7736002)(305945005)(36756003)(53416004)(6116002)(81166006)(8656006)(69596002)(8676002)(6512007)(81156014)(8936002)(97736004)(386003)(6506007)(50466002)(66066001)(76176011)(59450400001)(52116002)(51416003)(2906002)(47776003)(48376002)(106356001)(3846002)(1076002)(105586002)(6486002)(50929007)(42262002); DIR:OUT; SFP:1501; SCL:5; SRVR:MWHPR07MB3469; H:Pavan-LT.caveonetworks.com; 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; MWHPR07MB3469; 23:lmJ7Xvy0wfBCwuXrCfClXDwVQAlOxCKsbs3jQxf/m?= =?us-ascii?Q?i+k1DGGtA6XWq5yR1DAei6563VYPnHZ7TfyH9XoGpTlb8AIZt0Gs/h214NYC?= =?us-ascii?Q?4fJdG1igkQhDMzGGF4vFr/mHfOf7MO7GBKmAtgrmVJ254UXo/OeKS0zUvr8w?= =?us-ascii?Q?wKRwB5kfbpu0p4LLIUd1uNUAbh6MpzReuCFt0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aUTQYzE5qk70XGzMoTq8p6x6szzxrYn+svoVOwvzc5/hvTmJ0cw==; 7:9nh9WLI0HwihQcsErhFMlk/45fEQM5Dk4NMZ69F8a46oovC60yjoHKhDZNTnlRjmfLc+MNllKja96F1ll/gY23mFdN2zSe1pxKJDIeMcntrWFLPD84vHHcl6/XbISElIAjaH2FCRBsyFrex+M8aXbYIPh8a9u0KiSEi7rIVIOoYF7zLeBJn+oCKawv2+1+XgfKWPY2TLtuak4YMJtMZEsp32U1zEHojO67KbQWv6VF7SkOB5vY3X9ocaYI3PVmPX SpamDiagnosticOutput: 1:22 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:18:17.3940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43e6dfe5-4a05-4e68-ad72-08d55cf46028 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH v5 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:18:22 -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