From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0085.outbound.protection.outlook.com [104.47.37.85]) by dpdk.org (Postfix) with ESMTP id 67C7F1B019 for ; Mon, 18 Dec 2017 22: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=tDysOIfJTUSVwlz9eL7enPSELF2uOlH2Oi/aRAzzltk=; b=Qpl4CQtXp/iTFzWrPKKi4xOlDjH0OxGxRnTFvePYkS7yujBB3NzF2f2KKFwQoFGYiGzX2gEABHLgmRXv85ODCvE3ygG7taHerZnLn9lXmogW61cpBUFoDF8Cz6dEt27hslpVz+km7sgzFwzcakvC0Cr+j5VdMqrJFdmUc5/wXEQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Mon, 18 Dec 2017 21:44:57 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, bruce.richardson@intel.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, 19 Dec 2017 03:13:57 +0530 Message-Id: <20171218214405.26763-4-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0163.apcprd02.prod.outlook.com (10.171.30.23) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b6d5be7-4042-4f9c-94ab-08d546609731 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:BE0MfZHAmHZ9699ujGoU9dzx0AXEwHh5LYG4gs4DbO7USQywOauG+QA+uh3OcOZgJC7jX5iWoeuM6NrkgNQ/ZfBIFS0VnMiNURebgMdm5xlruBzDcSWI2E/8L6rgJmWkF02vVi8qz51zsKi3LRMvU9gg9UmLqX7+6sBEqP1Vf1OSMHWB2a5l4shRZDhx4guKJKY4LoiKHznARy8VuKn7Ac8XfieJGSsxGXZj3DMPccwEFYlu3IWAFbUUMZzwdyaR; 25:PnFKClj4qNywcBUxDlylVwWDdftp7TaFV0HwXhl+Y9O073PQt8owFkDNJzMOh+h0AbqrAh7BIsVMlc1FtIvLFfkLocEcsndxzXmAMbItviiL1TJhzU73/fPLeiBBiWLzG9h5BMP5BcOjT03lvuc+4GIYmxFLnxZeBWdPM3USDarDGjuCXwv/QM88H0RtJ14Sgpuxvi9cWnjX7iJH0mbIZH4BkOwOKzppIZILEtrJtjgBx2cnkyN6oiTqHoi1gW1dUwqM5CxK+C0qbF9ZFlGpA05BggtEvH7jt/TBuLH0R1v5TLUT3Lgc9r/EKPNAWv0YmYDMdOfo5dKHfc++mx+O3A==; 31:MCr8sQiRBnxrFOKEDn8o4YpGUJJs5Hr3hJx2+hfn6h/xUodZ6QDw6HOAdl0SzyD09g8RBaJOMjwdmzL8Oy1z/RjOOtxHgcdJg54PG98nB5DiaxYBTp362yhWC85F0xfZ56c8DtAwqyTvWbV8Dd0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-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231023)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0525BB0ADF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(4326008)(2906002)(53936002)(305945005)(25786009)(1076002)(8936002)(50226002)(16526018)(6506007)(386003)(68736007)(52116002)(478600001)(51416003)(48376002)(5009440100003)(3846002)(6116002)(72206003)(36756003)(6486002)(107886003)(8676002)(5660300001)(106356001)(105586002)(8656006)(2950100002)(42882006)(6512007)(59450400001)(16586007)(7736002)(66066001)(47776003)(76176011)(50466002)(81166006)(81156014)(316002)(97736004)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; H:localhost.localdomain; 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; DM5PR07MB3467; 23:UDi+C2dygEqhTpeaselI0Xgw72yH9EWgMVIOvUSGi?= =?us-ascii?Q?t2PWG+rOcCq6irfiYxfVrGrdIL2X/1WotpCk2RLaCPqZWw5fpWqsde/N4wcc?= =?us-ascii?Q?XRyDgO32dIC0FNWwWM99FXyh6otA1I5ap0OBwZ7OHGlXnXUiyjp6A4KDCOpX?= =?us-ascii?Q?aR2RrNRhZXT6Psq+2hV9XDSNzMSfiM0jG6G9+w+iSldztlH/HCJtB1z/0spD?= =?us-ascii?Q?Xk6+pyvTTRR5lUhv5S9pWLi8us5lzgcvtOpS/X0I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zwj66CIG0TVXZuxxZ3N0cQp5R5rwRid+4QgcZcH3omC0E?= =?us-ascii?Q?S731+LdISFybfI=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 6:k+ZbZ1cDosduWzAeVM4hmhz3eXgCGtdwhRY77Wd8QfgAP4wlgTFCvye6dMGgBxMbUTE5rrZQ2mfDYYpz6D98SQbzUwD/eJIOLgMGgVI0Y06iinzGesc3EcqSeMedIdzMJK3TnPdrayQENVbokP/HV55kTu6O/hqOHXg+k2EFvZHYR0BORlM7dEtbAds5AbNgFak0zQrMVqvTyodhprvu6Gv13PE2zC0mQd8vVNQaZKF8FuAJkEVLTHctCoCpd0WYPxGuz0StckhweTGe9ghHMgTTKQenjeHpVf4B14bihdDQx0YUK9iFHtCxkmVMe4xN+gV0E4De40A5+Zx71gNK3KtpOvHqfku+L+U20k+0swg=; 5:8ZhJTj7VvJQh5wgnjKgyAOVnuXKOOyfs/5l+fD7YnRO8LRT6XLigJwuCHFxq1nC9Mf0DQ8OdJikRl5Pu0OGt28ayuQlkWBjoubeSxxDWKm44k/BOInXucTTA7e6sLdQJQm7EBU7Tc7TV7lM5rswpr1VXPlT+9dleMZBVx48TabE=; 24:fTyrs0Cv4rV507MkyP7lgws1H83K0CKQJDLMyPZmH3UjZA+SlSEHg3Thrlo/GWNfDUGbdaXE5NIWImnWkcthUivMQG6gV9rexGkFJhCE2fk=; 7:fXGwP0sVEm4raZNdlO0slnCi+tJDeF1tC/g4+2jqW5J6jkEXp07ZayWpimPCblfVO8eJ8+eo19j0emOONc8UAS1B8LdyrDCt5il4lppw4U8b3Jqqxh48Evo+SgxxnXpaHxwlLCZh1CQhR3Ms+HI9LYx8a4FA8kFWwPBtc5PgZX7bEnMkWpXRR2xasuM844VhITdz6+Vk+yKfen83TSQZeDKoeUwZ1HpItwVyhSvb46pmROjGgCnmmG/kNQ9Kgzh6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2017 21:44:57.4897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b6d5be7-4042-4f9c-94ab-08d546609731 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH v2 04/12] 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: Mon, 18 Dec 2017 21: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 d34003362..d2ffcbe08 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -32,6 +32,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 35367d546..e709a1000 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -78,8 +78,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