From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 20E78A0096 for ; Mon, 3 Jun 2019 19:38:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23D041BB78; Mon, 3 Jun 2019 19:36:16 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 590841BB2A for ; Mon, 3 Jun 2019 19:36:02 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x53HKMDT027514; Mon, 3 Jun 2019 10:36:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=ClXojWags9Op7SNaZBzdBPN5grj3IWPSly3I/pv2pbI=; b=D5QDhXPhqnpPTZj52dZaN/+ORXanXiAG4G4LvjaBjycy0QkxeTHasy5gFV+8yjCKA2vC wbv2s6wrvH1DOPTAu/ftGIJ7AZIEJ0ufuHRF7zwon0EiURwzGXzuVZb67C4zNr3wAtGn H9yRxKPGgfaRlhRqnM2dC0o9XhbqboXim+By5pNpWLFrxNo6kfRT59O+34G5siBNPX3t 2WYhSfIxo6yD82gSmzsCKH8NgbIrabqaddSLGZDp4eSjFtofUx9j0r2GbSvT/H0gbPgP /u0yAlFDT1s5yc9+iVyjajEWza/serOTc+1blVUYZAzMNHwfXo6LFW7OH48PWFZ1fPeW Kw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr6vf-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2019 10:36:01 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 3 Jun 2019 10:35:50 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 3 Jun 2019 10:35:50 -0700 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56]) by maili.marvell.com (Postfix) with ESMTP id 7B1963F7040; Mon, 3 Jun 2019 10:35:45 -0700 (PDT) From: Anoob Joseph To: Jerin Jacob , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Anoob Joseph , Narayana Prasad , , Lukasz Bartosik , Pavan Nikhilesh , Hemant Agrawal , "Nipun Gupta" , Harry van Haaren , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Liang Ma Date: Mon, 3 Jun 2019 23:02:25 +0530 Message-ID: <1559583160-13944-26-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559583160-13944-1-git-send-email-anoobj@marvell.com> References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-03_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 25/39] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Lukasz Bartosik --- 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 a57f837..4dbb94a 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -165,6 +165,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 @@ -468,6 +494,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