From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0068.outbound.protection.outlook.com [104.47.38.68]) by dpdk.org (Postfix) with ESMTP id 6C96C1B220 for ; Wed, 10 Jan 2018 15:52:17 +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=lmy431Bm1ur9c4c/B2YNtetp8tgU6g+QEHQmRB4/jnQ=; b=aP7rOcST7g7tSi30wutDmZ8nOE/PozlBsQAC2rywaCOZ1UJRlJa7ElRmBRyrZ3Q+RUB+DY+9qsgdRN2d+mTZCnI0G5z0j6cZrgN7ss13FT/HNTYdq2jKUme8sL3tXn3bKOYIgeeRidvQ7jQwDLZg/UMFQys2iSyCXdlIQCdGR4Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 14:52:11 +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: Wed, 10 Jan 2018 20:21:34 +0530 Message-Id: <20180110145144.28403-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR16CA0009.namprd16.prod.outlook.com (10.172.212.147) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 137d1989-1f72-4ada-70d0-08d55839bd54 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:ZxYiAMTp2mcQUOLrZSBBQczRQ4/wliLBHjZvBkTv6Yvpf3HNRc73nkLHxcFeTklyMXwGcOZYduJGNIY2jBZYrx1D11zw9icIKkvEeU7BUfGA0xpvActrJeJ6u+vwsEMx8CqifgaPn1UnMc+qSAH7uboRbCoYalKQNpN+8t67YclO/U0EGSp00aBIX39yzcm6FlXSUHozbbQWixrtbUdiozBJ8VdpLha50Pv0C+aIKzmcT5kJ4gnhM0VX50DoU9h6; 25:Mhu8V76zJvLAHmzBv+nb4cJtknRMtyCmZnXbOXR6gpRcTPfgVGU0MRyAXA1MWo9lkdLTa6wDwrZe3JuR9qO1UObTbEmgzLdIk/EAGoU19T4jxOYlp8hoFV6FXNTxR7KfaK5O8DTVd+jwTv/ACqRRJViylHoILzIns1cOuS7r7Stvn8qlQgo4Z6XEsBW7dibkQ8gZeMxyhZq6rwoFg73X+vh6VY3N+EzXtTr9qd9lfycCuwjenj7HuqkQ0LP6BUdqz6KSQ0O74NMEFneDbWUSBECZuU9oXTmLBSN/t3t/T31NxqUOhV4nbGeK8TStjMp6TlgUTDBB3HJJsCtwhMlNXw==; 31:mabQsqzI3TfexBssc7UN2eBfHPh9Ys4wghyyotp9YfclHcuRKFRIm6nqNdd8WvRIxOUouK7FKFLHgTFbawjc1eVyI9uVRfRSj4keo7O3mqbjC1dklF9z3x4eaCvfxqyxAFm7waRb0dOHS+S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-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(3231023)(944501075)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(199004)(189003)(76176011)(25786009)(107886003)(4326008)(6666003)(2950100002)(106356001)(42882006)(8656006)(8676002)(59450400001)(105586002)(53936002)(6486002)(52116002)(53416004)(6512007)(50466002)(47776003)(5009440100003)(305945005)(68736007)(51416003)(386003)(6506007)(69596002)(36756003)(72206003)(2906002)(16586007)(50226002)(316002)(478600001)(7736002)(48376002)(3846002)(1076002)(6116002)(5660300001)(66066001)(16526018)(81166006)(97736004)(81156014)(8936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; 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; DM5PR07MB3466; 23:UKMdphYK9IKTgzNrU6em3jxH8G5mCYr0dPB3mH27j?= =?us-ascii?Q?hFFcbmb/2fI2MHcdkRmBwZNhWvx497MWSNFR5gQJjwe+VHSoyrHt97BYHrI3?= =?us-ascii?Q?xQ0i39NqeFPZKF9sTaSzlbrPeqrz2LX38IIW9hW0pimPqEcHNWeOV63e8Vkn?= =?us-ascii?Q?gky4r14Jrv1bjIwHUKTEYTGko9GwOtfFfYX9VScwcdQ4s54FaoysHcow5AAw?= =?us-ascii?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g4qLsnH1wO8nkygqCNWTnUBAtPI+hcXP2kE+d1vkuCFpS/W9cKcuif5+7i1/xDJ73tOR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 14:52:11.9975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 137d1989-1f72-4ada-70d0-08d55839bd54 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH v3 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: Wed, 10 Jan 2018 14:52:17 -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 --- v3 Changes: - add SPDX licence tags 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 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..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.15.1