From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0042.outbound.protection.outlook.com [104.47.41.42]) by dpdk.org (Postfix) with ESMTP id C161E7CD9 for ; Sun, 28 May 2017 22:00:18 +0200 (CEST) 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=vs0CbxQ12kMZcdlnI+0Sv4EvCaatr3duYsYylZt6zrI=; b=k88kUD8PNgjdEewgfNjZ+QMYEOMGGSbhVOBXd+XpwXLVw4jVcm1AqkKAv/3oz5rzV+0cdE0+viGpanp3+iE4Rmf6wpyLwzXuzY6B0GZ35fBS3g3mxDsHrZHNfQi18xuI3kQogKInljGFWUGFFN00n0Xk1EVqhqDbTcbyH/wM3ZA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 20:00:14 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, narender.vangati@intel.com, nikhil.rao@intel.com, gprathyusha@caviumnetworks.com, Jerin Jacob Date: Mon, 29 May 2017 01:28:28 +0530 Message-Id: <20170528195854.6064-8-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> References: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1725: X-MS-Office365-Filtering-Correlation-Id: 362a2ade-403d-447d-663c-08d4a60429c8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:PAjFFqfbrVD0cpp6AWo5Kw+NRR344Va9BYugmuAClvBzZMU5tCZ4obJuGmO0aX4+VK8DzDe8x1x9hiRP0gdXAQ8KPdSkmLLnL3duzgyx9EFT4sFN1B0OCmcpcPF3J2wB3odowiyzo5tGiYgqAZsYkamhcSeuG1bq18ZRTrMZvRg9xijn56uW5gcSNW2QLb9S7/IT/hClLkbcZXSh25kYQEDnZ/avXAr0vLGvZAuozeGkAwYxAuZNPWOLR17ozihZqLqUVJwDrCc3jIBFR+tGBzTERjZjDQ40w+vWKN0sRSv+WhYmZvW//MrPMMSYrIoHfaA+PS14hpowbKHAHfr/mw==; 25:2FfvsnKZyZeKotOE5EZ8+lrLIRG2SEjuUwEFfyM6h+6cXQ3H9Df7H8huh+CM2pXuZAeDpLCsA1rDizmPgZszI+JuKAGAu0gZczDDfKwkhCPRY3/RcOI2CXZztUlvhnilpxf6Y/nuvlza8cvZ7pHQsuOYfNNI+COfVoqe6nW1aoKaQwIQbC/OdaIRbB7z1djdnlMavKHzBNcpmV2R8G8LfBXdJSLDgtz5oqi7IztLXZBljDE9K48c8RjK78aiumv1uEJTrzv//ZJnWOMJfQ6Mx/GLdNvynRMgdemZNh2kE+PtJ5ehIix1xibIRCe9KwvFmMi3VbujQLj39dEGrFahYyn7B16JjBSZoH4hiESaQ+rxFJEu+cj2XCU19+8B2EPhLvTmmiLqSKFFnt1KuDYxDNj+nWT0qqhIqLqev9fZddkG+09+/9qRhOpzClatWWYQMxX+KqjoJLdSVoszOczeHC0kd97JscpA4pErIa2cfLs= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:iZZP9I0acaG3gMo3NVTfKgVNPqyBE9pyD/4SloNvU/+9LddfndZcYjKhiSVacT+Z+99aznJZ/GingYFEpu3VFJzxwpnzunXpNYv0aYy1NIe4H+nrkteErjVQly2RiiEotE7/D6k66Y6CUtI1nmB5qUzQMsdha/d6nf8YOq8rII9TKYyM4+DKB/8XfoGaIl3sKNkc/UCMXctsoFO6ONBeCglhhFBDhUsIeLawsbS89/M=; 20:nhL+XC05Ht1wOqXpbQ7yPZSs3tvUi4prZL5/SmCvdkQJHySs2daTVf6VDgrHIOtB07JzjmUqBjYeN88fQqaC86Ou2sTSxvyr933bW56FMzW8/b2HuAnT12EG6fZ/J2zXHmAWjUZZrKzGB5lyua867U+h5eIgMX8T13IoGOEMDyJx9CO/VbpE0ioIEsoywkiVfoDHHg8ubnhr4JQ07JTRtonpj2fcZOM7PhtNBtcIYO4q/J+0iwzNPd/Kp/+DokTt+CoHRhwGDgjqVaTQSkEW0MwXkWOWHGulsEWuU1dZJ5kqJPLo2o3NdBV7Y0v/wgNRllutdp8BV9fULuK0GPIsP36OyrxnfFPHpsVu0dz9n8R+PO1x/yCmNPfbB0or5e11cm7mvIIH9qgQjUMItasTJGEeGyoPmVDhwM1LtnzYyfOyAyuc80RDiWu6mAO/RPuU8c46MnxATYcRMLZTlISlZ14wvmll3TVrOjJ/jO7opKsljzcNJI0A2H3k2V4X1QGiu4VUVGBqsOseAnzFXX2OhMBd0lqaHCBOIQwQvAdd/vNb431w7ojbFa4z52eGVHQDgq/eNR2WL8B2a9kMnjaBf+Gzrrnm80vbJceQRCEM+fs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703073)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 4:Zoaa7dUAtLPXFhiQ4S18WzFDur8bih6naL7uTqv6?= =?us-ascii?Q?JFB0XOYVYcVq5rEQkH78SRUxux2mDMmlAuGkpuU1m+uwq5TwOO2Nw0mtcKbJ?= =?us-ascii?Q?Qtrfw0lru+ixKyb7e3LOqlB1axjDylDPCRRB18ideK9Ih7n8/q/y1pGdzt1v?= =?us-ascii?Q?SqmgyCMHi80VkPFKHgBmK5Nxl5eIAa6kbU4Y/EehAspr3mWLxUFpFtB7vPeM?= =?us-ascii?Q?/cMeGd3ghk6gCkiDJHTq6QWN0HnIwhx4nfZ0XdkyhtS04oumr7d/BZlnjTwy?= =?us-ascii?Q?LMj5QvdXBJ4Jcz2h/StaBChl8CsaCzADHA+AYFgxgaCLNVlsGEopXtaq2Puy?= =?us-ascii?Q?fnRrQpY9vCH6w5SwtwNVzypcVJZNj8wwrVXW+sY4TsUxtE4uyGOT1qAuLQeN?= =?us-ascii?Q?3aJgTB2ogx9IDi9f0gfOrQEuE8DM+APy/BN7JXhgIXz/lalrOfnWN/eFyCEO?= =?us-ascii?Q?BC+YT362M5rNJ4rFtPtDmejwyYAq8AwnqMhhrUx8dksNdC0bkA0CV8hAn6l/?= =?us-ascii?Q?96RQcmkVH8ShBpF4dROTZpO+iF1G/s0Y2kv3Jti0qoY4iQYe1lTLh+SVPxP8?= =?us-ascii?Q?jOZLX9joXL6qaY1PgtiHpm8syaz6k7UKL407JoMO8If6aZK0OT3wTYLvjwN4?= =?us-ascii?Q?/5aFNxUqKIK2IgIEtycWMpbVpPcvjWuRFGszXmF/8NhQqr/rCSHIVB+useN6?= =?us-ascii?Q?9oaIUT9DV/dJpej7Zifg/tKfECYqwUwLQmTiLGqZNnuk1/N2j8y4z9WW+89x?= =?us-ascii?Q?3NJFyS3YkHSYxCRVgPf1CAVREpBCoMRmrD0VqgPu9+lsAPnBDzc5kZBNJyMk?= =?us-ascii?Q?JDlYJpOzEptdeVv/gikTSaRFUOA5RgXxV7SezVW/+sEj6tjLukOdMpjd4VDf?= =?us-ascii?Q?yFSMByCvq2ow++h5eDXIEr16nvBXM/+8oXFJWxutksB+6rK6MP+iOTUn6c4f?= =?us-ascii?Q?ydPXw2JJtlDRduAQxw8PDGtDBv2z5kVcUX9rBqWv48d9B6hs+3DYIdMRKVWJ?= =?us-ascii?Q?23ZbTZXVxnkRfQHzPE5rEbSHhl1CiByTex1CRtSrff9iNodEFknF5mKDUWVW?= =?us-ascii?Q?lfDdL0Sb7oGabKR+FiDIAJkiuHid7Tudue6GIKr+vUye/AHNnB+1M/MU/6qv?= =?us-ascii?Q?nzimk4wgjSo=3D?= X-Forefront-PRVS: 03218BFD9F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39400400002)(81166006)(6486002)(66066001)(4326008)(50986999)(76176999)(50226002)(189998001)(72206003)(36756003)(6506006)(38730400002)(5003940100001)(5009440100003)(110136004)(107886003)(42186005)(53416004)(7736002)(8676002)(48376002)(50466002)(1076002)(3846002)(6116002)(6512007)(2361001)(305945005)(2906002)(6666003)(478600001)(25786009)(5660300001)(2351001)(6916009)(42882006)(2950100002)(33646002)(8656002)(47776003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnost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bF8OY+8JfOL3r9tHD5x+sdFDe2FLLkyBE2ITDUsCjxVOR3jCj6MvTF98IPQgLdp7HxHRfYsRnsRenYK0fxVdgXyiFYLpa6ts5pgZevhESTu2r9Rdti2oWgLnoMv14DdU/uBgWIK6tVWfHRbc/YExL78Ic/kGmZaAR93OKAcfw+ExrBvdI+iRO+W2t3k8xCdPaCgLiIt/dJIFeJnU5YNO5ps2wtQKzAyqNsp388nso6RDdIzVJfNL0uAtKouS+3hr+QU3wsvN9w7zDfCnTwjx4h77yyqZ++eazqFa31CF8BpCTJ7Tl51uDEHkEpCFD0tvhETAxwIZLIrMVxQD6f6FwoGHpMePMXqH67IowHjnNGwwOY47xeoGrCpInSY4++KPG4VrNxPfPseqIuOXXBscHi7ODaZq5KJbaEixBxJ0HGas1HqKsF67zCVmGuSMUARTXe6+MjUuuczij6IitSo1w9Vk1HtVIZ9fje4tVCTooEU1m2DqAnZ5ysjip5i/; 24:VYVpMUPlrKHhbsIulk17eHCLGooUliEyBNDZqdmsKPiICizEvCoiGGgGJXe4NebIYJjkx3TNyY+8WwdfZnlGUr/jOa+Z32Hxkufwfbx+rv0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:r5yBEq6c4kcVznjt6k0ZWwQ1D2nSOaqoKQ5c+atPPNRW4g3EGJIxl2ZrdjlZ4Ghp5llCdOpQu530KT1IYQJsxyuRjz89JPnwOw02CV7M0P278dk2yfqNgy91ENujlW6Cmetu8aKFqn7hvInhhBKkTDSYu5EroxaMYUmlz0fsSKCu1XoNRXz/ODrbAPlqOsZ7C3XqV2mNeUoHv16DmHNZ3g0LKv1jXTJ8lR9rThg2SzAuppDWj/Gmsqswj5QlVMdsBmCPr6oZJ0lU/jtxk1/l3UHgULmHklMGVwEU6GVfoVzC+ykAUgPO6eN4pYJDN7sJTDEPT9cdfQCfYy0HCKtD0w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:00:14.0151 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 07/33] app/testeventdev: add helper functions to check options 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: Sun, 28 May 2017 20:00:19 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Guduri Prathyusha --- app/test-eventdev/evt_options.h | 91 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h index b38dd4b04..1a932febc 100644 --- a/app/test-eventdev/evt_options.h +++ b/app/test-eventdev/evt_options.h @@ -64,4 +64,95 @@ struct evt_options { void evt_options_default(struct evt_options *opt); +/* options check helpers */ +static inline bool +evt_lcores_has_overlap(bool lcores[], int lcore) +{ + if (lcores[lcore] == true) { + evt_err("lcore overlaps at %d", lcore); + return true; + } + + return false; +} + +static inline bool +evt_lcores_has_overlap_multi(bool lcoresx[], bool lcoresy[]) +{ + int i; + + for (i = 0; i < RTE_MAX_LCORE; i++) { + if (lcoresx[i] && lcoresy[i]) { + evt_err("lcores overlaps at %d", i); + return true; + } + } + return false; +} + +static inline bool +evt_has_active_lcore(bool lcores[]) +{ + int i; + + for (i = 0; i < RTE_MAX_LCORE; i++) + if (lcores[i]) + return true; + return false; +} + +static inline int +evt_nr_active_lcores(bool lcores[]) +{ + int i; + int c = 0; + + for (i = 0; i < RTE_MAX_LCORE; i++) + if (lcores[i]) + c++; + return c; +} + +static inline bool +evt_has_disabled_lcore(bool lcores[]) +{ + int i; + + for (i = 0; i < RTE_MAX_LCORE; i++) + if ((lcores[i] == true) && !(rte_lcore_is_enabled(i))) + return true; + return false; +} + +static inline bool +evt_has_invalid_stage(struct evt_options *opt) +{ + if (!opt->nb_stages) { + evt_err("need minimum one stage, check --stlist"); + return true; + } + if (opt->nb_stages > EVT_MAX_STAGES) { + evt_err("requested changes are beyond EVT_MAX_STAGES=%d", + EVT_MAX_STAGES); + return true; + } + return false; +} + +static inline bool +evt_has_invalid_sched_type(struct evt_options *opt) +{ + int i; + + for (i = 0; i < opt->nb_stages; i++) { + if (opt->sched_type_list[i] > RTE_SCHED_TYPE_PARALLEL) { + evt_err("invalid sched_type %d at %d", + opt->sched_type_list[i], i); + return true; + } + } + return false; +} + + #endif /* _EVT_OPTIONS_ */ -- 2.13.0