From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0069.outbound.protection.outlook.com [104.47.42.69]) by dpdk.org (Postfix) with ESMTP id 4F3E61D05A for ; Fri, 8 Jun 2018 19:25:42 +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:X-MS-Exchange-SenderADCheck; bh=Tg3OH/VPyaf+HIsG7lD+cUX31BlntRvtiMPnPyLC4/0=; b=kI0annwFLepRw0fFNw7pumJrYwKHdtQ8yd1nu9Qo+WLNXJp5FWHd74ZhFDKxtiJlb47CqVPw4pH+Q9H4gfkGc9HHeFwpqe0jbiRLBFR+I45SWf2EuWvqJwc90AaIAtVEOIEJCf8kafMY03Uz1JSMlrqL89AIr2rUZYXPKq+TVUA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Fri, 8 Jun 2018 17:25:38 +0000 From: Anoob Joseph To: Bruce Richardson , Jerin Jacob , Pablo de Lara Cc: Anoob Joseph , Hemant Agrawal , Narayana Prasad , Nikhil Rao , Pavan Nikhilesh , Sunil Kumar Kori , dev@dpdk.org Date: Fri, 8 Jun 2018 22:54:11 +0530 Message-Id: <1528478659-15859-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::12) To DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4906; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 3:5Pn0gx0OuYc8p2gDg8ZVKryR30mwXuxvxtDdbEVmf6NLDXkaZWrIIpd0SdF9/H1FcaoEXQEtmC06+uBfbWVejFmr5+vhMtR0xWxS4d4dFo8OhlGSaJAwkO00ArMXQceN4xX/xtiGeB5BfmT8PURS+Hu7SI1t0e9RgoIse61v9mciiszsIzw5KkT5ssDAPiHgsVLZ5WOgimH6icZ8Trw5yYoxQruyl5AoQtEhnA6cOnypOkpj7vBPewhDsb2Vuw+/; 25:cJ+UewcAWVGj9iLr9bHR11z6EfgvuBO7fbL/fRigkbXOwkXlk2q6wH6N2LpIzIA4A5BhsO44T+WdJw6jUdDwkOcC9YatSnPNYs+X5ltxKqCaLKDXjEhzbrzJvco9HWk9kt3oldm5hhoyJppHHz7B0DOz3TWNdwiHHo8f7yxvtEKiKdyqLyaGwhHupf00/KKNQdDFxK4V2g5JZZwfZ2RkwIW5r4Szvja8jbogy7I5MzEENMIE4/DcG/+cmzo7nMN1WBfglOEsvyHnt+boH7sLrhyZ7e1C/Bh05LY0ln1QupXaU7a6Wrjkl9j62Uq9HMlkp+Hrw3cDjSQHVFugKqbLgA==; 31:52xy68MshimKYGEEoND0D0sMStiJm7WwRYEeLDUAl9otiOtlye3l2hA+fdXUx2Ziq0aSyOPoNHTzLns3Tn+00is1LzbOJ0Y7hOGSjCaHcNlnufahPpXAurH6d0BOXAar8CLqAwgIFPN/hrXpxJSLfBYDkGJMPScfNXHejIhMXN1vMEvcofZPWmYitoi5Fkz6EmkUCvaFAjv2gYD0Kceq6LUevgV8RLpLhOk4AR3udFE= X-MS-TrafficTypeDiagnostic: DM6PR07MB4906: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 20:K0tUPM0zp5gqAjBf37zTM5kvjEnHiFodS3680nDACWSk29xmrKvVyYZxg5xtp5tO472k8KTq+RNeoyJSOM8tpVfmkw+CqEpIhUPaYlbmr2Ehfs0szXtrCqDhKvwRGj/F4zEUiFrepiLEC5E4khqREQqBdr33zDY4V25axkUyvyHsxuWHoN50Phni8limdTvz3uwuNjzy2Dk8YnMNA2YBBjWc9l6bnb1vmYsDCFxKPSR6vnw7CDcVcMGcdAcrR09deMC+AYDFmhhilg21+cgYb8T2bMucbCTgU+LUYjKV+IHCU6zxlnNNvDxmdivtZOVlOo6fZkvHXTD8Yg0aaiIFnyH32fN7ROYCpveQwSmpZlegstSOLgbrUkZVTlRrQzcm+/Bc8iUbNVvaqd8oLyH9VmK4o7lzpor+bpZUqnTgmDx1LJlfjOq0dv4s+Kqx8iuBNgtWWBevbjAGYGkNWS6JhFhFkpUMrXIBbyG2Tn8u2RHePXIX18gPCX7pTsEYB4FemoUtlosvwoz0QZXhry7A5mQo4awg/lVVbR3ZqV/OaPvUjkV0qsm8i0NYYimUj2bOhnB0YrCy+ve3u9afKmv9/M1ni/xDTcTYhbkOwVoZW98=; 4:/LyMS1DDuRlTIIOtwhH3GgVQ1QYfiAIhIdCCRAEH48eisiF46GBlX6YIp6dggj3t+2OY4zpXOAcqTSnK2p6ZcKHh0pfu4pA2RSkWR2Vw8EFobwgGgEa4aZBQAcbVS6ovGo1579mSsI0wmRMuF05ayrVm7KQO3hLGBKhaNYIheceifQgYcKtijcQzRkdwHTtLG0TPa98GaXM6r8G62hx/+d6zPaewnCEVPXJPJepe6IZKUlgUuvsNRlZ0PH6kMbk3RceoByluVGL328CN1emKUA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4906; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4906; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(189003)(199004)(186003)(16526019)(5660300001)(26005)(42882007)(55236004)(66066001)(47776003)(68736007)(6666003)(305945005)(15650500001)(2906002)(8676002)(7736002)(8936002)(36756003)(52116002)(2616005)(956004)(476003)(446003)(50226002)(81166006)(11346002)(44832011)(6506007)(386003)(486006)(59450400001)(76176011)(51416003)(48376002)(50466002)(97736004)(316002)(6512007)(25786009)(53936002)(6486002)(81156014)(4326008)(3846002)(6116002)(16586007)(54906003)(110136005)(105586002)(106356001)(72206003)(478600001)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4906; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4906; 23:yTzEm/eWxbe7JfiZVauTPYzf9ERLq/x7IyNo4MbBO?= =?us-ascii?Q?QjGGC+kABqlMUHKSivhamtwFuKtnNh6sl/g+iuWnHszGLZTbegQJHZvEpugB?= =?us-ascii?Q?E8mklGLWEFA85FM0VmEopwDU94c37UQIDTR0Jqcyy+aWHVnBwSp+I69EpIkj?= =?us-ascii?Q?oHiCOgG2Rkb2GRCnrn+fjQYi/P/m+9kIQKfSAf6BxR896KrHF/xBU8dGhQwo?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3nv617z3kuOsv0Spp/6ZqA1qO+UuFb4Inu3O?= =?us-ascii?Q?UzQrsQeY/esktm0IUbP/ydjj4kOB9PpdDYQqeN/o/D53RcxHW49mKzTeKlhf?= =?us-ascii?Q?tfOxP5btS3OUy/uWWut4PP9V081E3hNgQig3X8Mh+eh7LdZqqv7d8K8SUoDQ?= =?us-ascii?Q?Qr218Nj1xtIiM4vs5wyRjU2MB0M5TVaA11evEOlniAvR0ZINXlko4y7UvPm2?= =?us-ascii?Q?zbw/Cs6xobrkAIq4EUJgfDt8plMfZUFuaZ7n2k19L9K?= X-Microsoft-Antispam-Message-Info: WZrTrj76PES6Ck7wi8Ufgnta5gLsg4d6WCtSVkMi586+XZbezmVqwInwKSmasJxv2eyqVty/oVdfJquh1CgYeWBfD1IwQZISggk7KwkdEK9MZi0IDTvME5AeIQL6zyCTOeA+p8fAiyur7hfK83zMsYV/kBm1t32lu4VY7Ye5UQXNln6wOOPcJKDoGEgU72Gh X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 6:uibVNmOHrVc0p+UBZmStmk9CCxnwYcYyq71xSZPgHolCVVQMwlp2djLpH2h4SWzlHwQV9zUqHtHdkKb2OFlNa5SFqXhbVptY/H2PUkzdBxTbqXvLFzaVmp88y/JiVjx+4Hcr7XPlKTZZSdI/TxzvpinvhplTSHa8WVPwpSs1nXfngOGCn3xRr6VhzkratHDH+8T2nlKO2GithB0DRdWmPNH8jS+W2miDCxBwS13IeSiu+EC3rfVyhUg7IQSfSkz2WEbNYJPXRWygDTPp1seIg1SVRffESjF+MvcSblBSWFCyiQp72T1ga0xoBRhQokQFCm36cg82MwKiz6Ml64WVpG5EEFQ5s3hm4aJ+3UuQEDyTXpXkbVekGikgdGyDJbs542yEQl6KmGJmRRWND8sTaHik0GerxohUVBSwgYt8W9Uuye5LhmXcY8LLhXlp/g9bmVOKqpzj9P6tMCNv/1rz/A==; 5:EEcZaur3ES4ca5Khh6Hbms+i4gSfcP6ApmJLtxsfnGLBJFDp8JWm5gpNYX4e5d6bmdUY5hG2lpCuP+ow+Bj1TiiuQQ3Eml2+0NPb2y27Y7sBxlLVEKEenj6jb1/0KfDEMryPyZY4UykA8DPHkX6V0IqlHNl8GDAn58qTAL1tVc0=; 24:FdolpNLVic2CaxuLikDalBnWB2OlD4TqdPdbZVwkAPmZuaAFPnRqkms/neFNN+M5egSOqAkBzeZQ1g/nvZt3MbPw9Pnrs/le3LXX0MQpPHg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 7:B5lU5cT1AgbKpAc14PGagY5KtP14UZqEud1lzVIIf/fcz3JYy89qm4sZRr0W5fmLNTFbUecFiob9Jsad2rDLkbxXs8JXW2JIDRcxjaqrf++xT3jo7vtn4fg0oqvBReiSmn1DtQSERbZFU+DKRHaYtl1/Nq6PfTAm6I0R0XE2/eZ6dAtblbRDCQ/k2p78Ta6burYwIyDBbhpFUEVaueIy8plOrH6WS6oW7PFokUvI0gVLTkaF8m2HrnqShRC0xYIw X-MS-Office365-Filtering-Correlation-Id: 3ff0ced8-dd59-4510-55b3-08d5cd64dbc4 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 17:25:38.2012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff0ced8-dd59-4510-55b3-08d5cd64dbc4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4906 Subject: [dpdk-dev] [PATCH 12/20] eventdev: add routine to validate conf 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, 08 Jun 2018 17:25:42 -0000 Adding routine to validate event mode conf. This function will verify the conf requested by the user and would populate other fields with default values. Presently, the function acts as placeholder for the above mentioned actions. Signed-off-by: Anoob Joseph --- lib/librte_eventdev/rte_eventmode_helper.c | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c index aade9e1..8dbbd1a 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -182,6 +182,32 @@ rte_eventmode_helper_parse_args(int argc, char **argv) return NULL; } +/* Pre-process conf before using for init*/ + +static int +rte_eventmode_validate_user_params(struct eventmode_conf *em_conf) +{ + /* TODO */ + /* Check sanity of the conf requested by user */ + + RTE_SET_USED(em_conf); + + return 0; +} + +static int +rte_eventmode_helper_validate_conf(struct eventmode_conf *em_conf) +{ + int ret; + + /* After parsing all args, verify that the conf can be allowed */ + ret = rte_eventmode_validate_user_params(em_conf); + if (ret != 0) + return ret; + + return 0; +} + /* Setup eventmode devs */ static int @@ -498,6 +524,13 @@ rte_eventmode_helper_initialize_devs( /* Get eventmode conf */ em_conf = (struct eventmode_conf *)(mode_conf->mode_params); + /* Validate the conf requested */ + if (rte_eventmode_helper_validate_conf(em_conf) != 0) { + RTE_EM_HLPR_LOG_ERR( + "Failed while validating the conf requested"); + return -1; + } + /* Stop eth devices before setting up adapter */ RTE_ETH_FOREACH_DEV(portid) { -- 2.7.4