From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0041.outbound.protection.outlook.com [104.47.38.41]) by dpdk.org (Postfix) with ESMTP id 807721B01B for ; Fri, 12 Jan 2018 17:45:02 +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=dRVqzh3ZktmknSx8a00mcsfhk4+W/diVKW9aPZteW3I=; b=Cvh3V8XMovO6l472h1dfuXKzL+gP120t29GIA/uuz1dDgJTTXI9Nynd5O9bpxoXmYpd09pLeYbazGsCLTt1cwnciEatkztHS52uImhGQyQCKMTblZfIrxvTfYKPTKGALjJ42jiUdm8GB4twGmaRINUZTXiL3zdmTnMp/VYdl9wU= 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:57 +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:07 +0530 Message-Id: <20180112164416.21374-4-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: e146c3ab-bd7a-4d64-c8b2-08d559dbd255 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:L5OhvL5T2WPLpalRcLPQ2pp4HIXbOq2DJzXME/YL5C2Y4rpxzjKMH3OUDeNxAMcRP/0IYSOLrfC1ZS5hEYTa0lA3nS+O92/NeggZyrNSGVMbXzWoZx3vKyx6EKd+PXSnXDFe9zxnXHpSGbjmanV3RNej2ytOMfC1WHEfBkvqn5sO78NJsOdZU972v0wMrbDvFhz4aiHWKKBmJRdQSy7e92uEGxcqSDOqsCq5teLGNhs/7E4AVs11qx1a0MLSODkF; 25:DkuAIf1QpBVdvHKs0KBPwwUB79aqP7ijIrNrFNwB7JrugCSR4skLwhdLoEH5xdXUZWDXPknnT09zjfjzA0iQHjmzSMkj7cbo9Y6nVHTfSlkvFrB/XNObXq3fkBM8nfrFrUbVZ69HdW3feO4T5Js4a17z54Dbuph/I9CzSjixR1ovQnv5nRVX+zqt1p0A3ot2YEPdJvl8zTZDV7yJsizNEBkT+nvBJfvn5BPgs69FqajWRP3ZmUNOTTU0Bw5/ZCaRvsj8NPT9wcWNRBQCxV6qVgzknquOksZeQtjbJ25HCDy+z3L0y+otwnHN7GL9vaZMa8T2zer63xVDIHQRgxs7sQ==; 31:Pc0V+LxeEHvKsxWqUAxlq4Ue9H6tzk1K7BUJZEbcO8q+xeE5yaOGSneXizATJqBP6Pmvr3ghbGZ3ha4DRq5abeW1I9Ds9/FUWoHGE6Tkp/Trzv5D3csUwwV06mwRgeune9rLd/D0tjbKFC8er8q7SuRROTVMVxExSwLM3wnfN5RL5str89NVlOHfUfsMgforzUl27TNglVY+TH542wnwVVCrjXFpH3MwF+Z2VNvvN9Y= X-MS-TrafficTypeDiagnostic: DM5PR07MB3465: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 20:Hdh8elrnGMbQJ2nQL7kSh0i25no2EcstryOW6u+uWUS6Z3sI3PERAXYOIU8d/H9yDQyUwlTMzUUkfLawszG0PMPL5uXwmYGpX0C9KeYHFRTGlunmtWz9bbw6ix6Dt03qQ2Yc1lCypifdWjqgX2opCjtEaAXJG7Jss/zDqPdTeOJu+0ju59QfF8nvJC15rrtgoa8Ksx31XNqXeMb5u9eCLwepj1kCDTVy2bbuP8NtRIOAwe5OQJBkdIEZI6brGtcvQ4teoM62oVkxL31x66X1lYxXwlynu31rvPNUJSClgpB5PWBFaCUvksr0rzf3C591UwoWsTqWLxbJP9r/hA4q6nOoLLQtvLxNlD2MxPjC7eK3weRlBVNe3q38WF7jFJolKmmxOTUMniqqbdhqw8gQmuXvPCrmYXBIjH2f/mwoUM4YctLWG6y+Qt6x+Eiq646/SukjkI2PyfuFHgy6MM4VWPVi8mFHJQneLpepOfvh22XTGOb8e3HFbBNXMcOGbU/cdNnuQABTdUhbqzp+nnXm4SsICzX0Cy23r3qcX1Yvfs4DR0nZ0/rmEi58NbGSUqVqYwOD10odnQlqRFiPlZVOt3hgZNgEQr1CbpOlgiXjQaw=; 4:ZNHajfPag+FMVLyMD6W/dvjVe32Wp/fJio6F+AlqaDwK0agIEmvHFOtN8A8FYVC9D8Y8cLGZ8/LC7LE0qucMrkR8qhI/rFFN7vXdCh3xQ7FpSPskvTn6Tp0CWREJmJJhGCENoEeqhI32Xxy0ERzUt2nT/hZl86zXPjxO574CXFMNXOmwqWpXabo+K5PjlcO1zumP8fQRTGrsiVIu9iInVHKnMnpFJVZNPin2fDg1iCGRkkuYueR576amtATfQlFGiqaBnfvc4vjlnCBsSw+LFw== 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:aDkIjAH+OTT9Sgugh7EuGpPVxfMEb1gCKth599yVV?= =?us-ascii?Q?FV2uubFsxEd2U+zIvFBnPyOVpuOnTY8HkWgRgsA2KuoDKgIL8uB2QiLyhPq2?= =?us-ascii?Q?ajSqgAGFFv5m8rez/jqCCMJCZ6EM9iJWWoWdK0xbIn7DgNaE4v3tjN2GFecG?= =?us-ascii?Q?5zPh0DAXnC5P90k6+0bqBBA/oUblbxxaKdihQWfH6aNjsOsSP5f5bK06jdP5?= =?us-ascii?Q?3K5Hg9kxSCe2e/khRmONhqoTVty7OiTQaLX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5OTEPRz8RHk4ZnDTcAryWCvngWya6ZVZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 16:44:57.3246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e146c3ab-bd7a-4d64-c8b2-08d559dbd255 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 04/13] app/eventdev: add pipeline opt dump and check functions 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:45:02 -0000 Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_pipeline_common.c | 84 ++++++++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 3 ++ 2 files changed, 87 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index ff60fc36c..45e0652b8 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -5,6 +5,90 @@ #include "test_pipeline_common.h" +int +pipeline_test_result(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + int i; + uint64_t total = 0; + struct test_pipeline *t = evt_test_priv(test); + + printf("Packet distribution across worker cores :\n"); + for (i = 0; i < t->nb_workers; i++) + total += t->worker[i].processed_pkts; + for (i = 0; i < t->nb_workers; i++) + printf("Worker %d packets: "CLGRN"%"PRIx64" "CLNRM"percentage:" + CLGRN" %3.2f\n"CLNRM, i, + t->worker[i].processed_pkts, + (((double)t->worker[i].processed_pkts)/total) + * 100); + return t->result; +} + +void +pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues) +{ + evt_dump("nb_worker_lcores", "%d", evt_nr_active_lcores(opt->wlcores)); + evt_dump_worker_lcores(opt); + evt_dump_nb_stages(opt); + evt_dump("nb_evdev_ports", "%d", pipeline_nb_event_ports(opt)); + evt_dump("nb_evdev_queues", "%d", nb_queues); + evt_dump_queue_priority(opt); + evt_dump_sched_type_list(opt); + evt_dump_producer_type(opt); +} + +int +pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues) +{ + unsigned int lcores; + /* + * N worker + 1 master + */ + lcores = 2; + + if (!rte_eth_dev_count()) { + evt_err("test needs minimum 1 ethernet dev"); + return -1; + } + + if (rte_lcore_count() < lcores) { + evt_err("test need minimum %d lcores", lcores); + return -1; + } + + /* Validate worker lcores */ + if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) { + evt_err("worker lcores overlaps with master lcore"); + return -1; + } + if (evt_has_disabled_lcore(opt->wlcores)) { + evt_err("one or more workers lcores are not enabled"); + return -1; + } + if (!evt_has_active_lcore(opt->wlcores)) { + evt_err("minimum one worker is required"); + return -1; + } + + if (nb_queues > EVT_MAX_QUEUES) { + evt_err("number of queues exceeds %d", EVT_MAX_QUEUES); + return -1; + } + if (pipeline_nb_event_ports(opt) > EVT_MAX_PORTS) { + evt_err("number of ports exceeds %d", EVT_MAX_PORTS); + return -1; + } + + if (evt_has_invalid_stage(opt)) + return -1; + + if (evt_has_invalid_sched_type(opt)) + return -1; + + return 0; +} + int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt) { diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h index 569db1de5..6e43eea2b 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -51,8 +51,11 @@ struct test_pipeline { uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; } __rte_cache_aligned; +int pipeline_test_result(struct evt_test *test, struct evt_options *opt); +int pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues); int pipeline_test_setup(struct evt_test *test, struct evt_options *opt); int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt); +void pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues); void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt); void pipeline_mempool_destroy(struct evt_test *test, struct evt_options *opt); -- 2.14.1