From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0056.outbound.protection.outlook.com [104.47.37.56]) by dpdk.org (Postfix) with ESMTP id 897A71B2CA for ; Tue, 16 Jan 2018 16:40:45 +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=uDzn4pA2YHaOG2+Op5jmkz+c9+iq+iNgrDYIM38jATk=; b=fk1c74qsjlW12T8HebJ8rtlWTQSBRiYd7nBtKjEpC8Lw4CQG5M4FwxEEqyT96hVXmhM0Io7bpiDm5MuoTlFsxY5y5WhrCiD2EKZVAhKuZ5jxCXxok+ogm2HXJ0TgFkDIBymOeweZtkw7h5CKoIKvgsZb3LTpTed96uwLv5RfXys= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (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 15:40:41 +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 21:09:53 +0530 Message-Id: <20180116154003.3762-4-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR02CA0016.namprd02.prod.outlook.com (10.168.209.154) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2bb44fad-f8d1-43c6-eabc-08d55cf78169 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:gpBav3T21G1Mq7AXoedy6yB6CQIdZ64KzDXZrerDHlMcj6RmyolK7/HASPGCSqLPJt9mWDj1vGYSYRQytEcBMzL4Io/z5OgtGo6DytbbS6C8mVxALqFejORiQhqhfUIwcDxhDAy7CLZGpHs/YqaoVJxhBdHkLTsVP1DWwnZyxGYxGCJg6DeytQGvieZiiYebXpTmsT5I6rHv3MYzHWwzRgzie8M4jW0zeAD2udKFv6RA7rt+44trLil1CNN/DuAj; 25:mO/cJGAkvRtkACzJWfVpiPyttYQyLFNGhC0TqQio6V92cBl5ksrzgupkyNid+thXr4KXriaCGfarzy4Vn2AxvSvgMlyMIQSrqg7JldpxAlW5FecQ8C2dObGXv5mEL8Q1B1jhSdTXDd1zsdxmXp/vPHHmUPxCUqysRhbdwsRkvteEPMEqkHSE+w9heRQrwOTg9+aazxBtkbpy6n7NA2e6BnROBugFjOZraPCd7fEEaJrV34YCvHtQrAJbO89XV2SPpNsGOTc3UqQnMTNiERw/projITy5T5GayOdW2D1nStDN0haNkKbPN5/jcnCz+7tJ4vvfmrNCr3YxkXdUD5ClAQ==; 31:NgX2jMXlrpPE3KuO4+lKZkAan4tMlpOQVevtlkLcj9/tEb1a4l4O0yDCuO9ffhxf+0m58SKLNlzrfiuTHb8iL+Ey+rt2aYaRSwz7lgcYx1yq9SH9Ua3QLvwIMvkbIb5wY4HPYYU13+rJBelnIWGWtOrxXYH5wyOYbpRekcQq3WT1m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microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(3231023)(944501161)(10201501046)(3002001)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(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)(39860400002)(366004)(346002)(39380400002)(396003)(376002)(189003)(199004)(81166006)(97736004)(8676002)(6116002)(5009440100003)(52116002)(305945005)(8936002)(107886003)(1076002)(51416003)(81156014)(25786009)(8656006)(4326008)(50466002)(50226002)(6486002)(5660300001)(3846002)(7736002)(16526018)(68736007)(69596002)(42882006)(106356001)(26005)(76176011)(53936002)(6512007)(59450400001)(47776003)(48376002)(16586007)(386003)(6506007)(66066001)(72206003)(2950100002)(36756003)(2906002)(478600001)(105586002)(316002)(53416004)(6666003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:nzgSlmAv2bbBNm/kbtJ1P+ArdadSZ8S28/j6Ld7kE?= =?us-ascii?Q?uJTNlJbqo8gEfPMi1P5CJzil39fDyUEJANDJJOJSU06L65WWkeTTf+E0VtWY?= =?us-ascii?Q?hCZVySuEkNT0q9PVBzH/i2UzylMqYJAfh64yWiMPu8zrJVxyS2IEAV3tgNID?= =?us-ascii?Q?syB0S+9ObApuA8WsOfCGqd5zV3JipoionyzmY3MV4s74EZWgTDk/z4soaiGJ?=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Ezvi1465nP2QBLBrW3mDG8vWv9wqnSF/n3aE1bnAZ530fmuNTOc/bB0KhBNdjKBOZsBL34UhAT5QS+O60nBoGHmG4ZgKGk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:40:41.4891 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bb44fad-f8d1-43c6-eabc-08d55cf78169 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 v6 04/14] 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: Tue, 16 Jan 2018 15:40:46 -0000 Signed-off-by: Pavan Nikhilesh Acked-by: Harry van Haaren --- 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