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 82947A00E6 for ; Tue, 11 Jun 2019 10:58:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA6DC1C306; Tue, 11 Jun 2019 10:58:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 958F11C2FB for ; Tue, 11 Jun 2019 10:58:23 +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 x5B8rcXr027946; Tue, 11 Jun 2019 01:58:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=hMZvgrBy1BAy/mH7l8PS+bBvkFTNVbXPPY+LDjMGHWE=; b=K7/oC4gfdzQyiKdDub32iqjZb+QuVUT3l0cXI9Ki45vy8kiVFdLzmswDaGWhWpQGQHAm 5k5ehS9ibC5VPCvBhq53p3IfP3IDBTh0S2SLsGK6xEmsGR6+bbw3emZ/27jaXk17Rf7Z +mm32juEpFN5Q3nmxMv6YKOabM1akqUzHfrJlrB2UCnYAL7pt6ES/zh1FKtrHT7Woiec hjGfS5GQVRblZBF8q8Zq1TVDzgpKRZ92eepgI8dERfY2enQFwGLUdKaBrPxr1H8hZqi5 jGcN1t6hm+HvG5doHDg74qkvSU6zKTpcE8weZDMdt9ZfwMayuUu0/05VNi0aJtAVW626 6g== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2t20f4sy45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2019 01:58:22 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 11 Jun 2019 01:58:20 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.53) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 11 Jun 2019 01:58:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hMZvgrBy1BAy/mH7l8PS+bBvkFTNVbXPPY+LDjMGHWE=; b=LglqP50StWSj0u5kTCMlpoXB9KIz1fUk+gtPSbyVqkHIZ3L5kuubhn6Oey+5AICQkkMk3lWG6JkJm5SotUTR1DKf5T0g2aIsBorvHUVvk7Q83A2rgx+lWnHIHm1YtYXlI8Lh+uf+imSKEti8hJuS+KUnRFq7IOMgnOi9evOyNsI= Received: from BN8PR18MB2691.namprd18.prod.outlook.com (20.179.72.94) by BN8PR18MB2835.namprd18.prod.outlook.com (20.179.74.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.17; Tue, 11 Jun 2019 08:58:16 +0000 Received: from BN8PR18MB2691.namprd18.prod.outlook.com ([fe80::b86e:d3b3:34b4:377e]) by BN8PR18MB2691.namprd18.prod.outlook.com ([fe80::b86e:d3b3:34b4:377e%5]) with mapi id 15.20.1965.017; Tue, 11 Jun 2019 08:58:16 +0000 From: Sunil Kumar Kori To: Anoob Joseph , Jerin Jacob Kollanukkaran , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Anoob Joseph , Narayana Prasad Raju Athreya , "dev@dpdk.org" , Lukas Bartosik , Pavan Nikhilesh Bhagavatula , Hemant Agrawal , "Nipun Gupta" , Harry van Haaren , =?iso-8859-1?Q?Mattias_R=F6nnblom?= , Liang Ma Thread-Topic: [EXT] [dpdk-dev] [PATCH 19/39] eventdev: add common initialize routine for eventmode devs Thread-Index: AQHVGjMVvS1s1z6wj0S9b3x1DAE1mKaWKQ2g Date: Tue, 11 Jun 2019 08:58:16 +0000 Message-ID: References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> <1559583160-13944-20-git-send-email-anoobj@marvell.com> In-Reply-To: <1559583160-13944-20-git-send-email-anoobj@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 12f99522-c916-4da8-52a2-08d6ee4af1b3 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BN8PR18MB2835; x-ms-traffictypediagnostic: BN8PR18MB2835: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 006546F32A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(39860400002)(346002)(189003)(199004)(13464003)(446003)(186003)(52536014)(74316002)(476003)(99286004)(53936002)(26005)(7736002)(11346002)(25786009)(6506007)(7696005)(76116006)(305945005)(6116002)(4326008)(64756008)(81156014)(76176011)(3846002)(71200400001)(102836004)(66946007)(81166006)(71190400001)(66574012)(66446008)(6246003)(66556008)(66476007)(256004)(14444005)(73956011)(9686003)(55236004)(478600001)(2906002)(5660300002)(86362001)(486006)(8936002)(68736007)(33656002)(110136005)(14454004)(54906003)(7416002)(229853002)(55016002)(66066001)(6436002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR18MB2835; H:BN8PR18MB2691.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mR7LD3WrC+JeHYFDOVAY7O+qNLmliqm7Xmrw5Mq0uXwG5HBy4oQ4SPGrRvufLmRg+0RvMzG68AxPbknwsNQRIxyltG96bNw1t6/aCXWLcBU8Tu9UY7C4nfslA3bqXoUTnAxtRB3FYdMZij6e2Cbtm35Q8lMJb8jIwWSZLASvpMXNkOGoJwGMptJVhA46GGtyvnAJxuD5ramb+aogbvR4q7itYdA+aZU26BFjCisFZ36VL4AXEXFZ6ylNLbqAK1FEI+2fMrteKtMsrsTNdJJG4pJXmJbYuXuBvwmsyzoqwyx5JqBCnG/qvKgrkor8z2gcTC6wgOsfhWzucNydf1Y/PqUIgCiKLc1nKbc9fcwnvQViRsqbcVLqTr38VK6vfSyGnKYkSC21TSUfVv4HAUwRYpX8UxFNSFlyJjKDSLo7Ipc= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 12f99522-c916-4da8-52a2-08d6ee4af1b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2019 08:58:16.9015 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: skori@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB2835 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-11_03:, , signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH 19/39] eventdev: add common initialize routine for eventmode devs 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" Regards Sunil Kumar Kori >-----Original Message----- >From: dev On Behalf Of Anoob Joseph >Sent: Monday, June 3, 2019 11:02 PM >To: Jerin Jacob Kollanukkaran ; Nikhil Rao >; Erik Gabriel Carrillo ; >Abhinandan Gujjar ; Bruce Richardson >; Pablo de Lara > >Cc: Anoob Joseph ; Narayana Prasad Raju Athreya >; dev@dpdk.org; Lukas Bartosik >; Pavan Nikhilesh Bhagavatula >; Hemant Agrawal >; Nipun Gupta ; Harry >van Haaren ; Mattias R=F6nnblom >; Liang Ma >Subject: [EXT] [dpdk-dev] [PATCH 19/39] eventdev: add common initialize >routine for eventmode devs > >External Email > >---------------------------------------------------------------------- >Adding framework for common initialization routine for event mode. >Event mode would involve initialization of multiple devices, like eventdev= , >ethdev etc and this routine would be the placeholder for all initializatio= n to >come in. > >Signed-off-by: Anoob Joseph >Signed-off-by: Lukasz Bartosik >--- > lib/librte_eventdev/rte_eventdev_version.map | 2 ++ > lib/librte_eventdev/rte_eventmode_helper.c | 51 >+++++++++++++++++++++++++++- > lib/librte_eventdev/rte_eventmode_helper.h | 26 +++++++++++++- > 3 files changed, 77 insertions(+), 2 deletions(-) > >diff --git a/lib/librte_eventdev/rte_eventdev_version.map >b/lib/librte_eventdev/rte_eventdev_version.map >index 1199064..e156fa0 100644 >--- a/lib/librte_eventdev/rte_eventdev_version.map >+++ b/lib/librte_eventdev/rte_eventdev_version.map >@@ -130,4 +130,6 @@ EXPERIMENTAL { > rte_event_eth_rx_adapter_stats_get; > rte_eventmode_helper_print_options_list; > rte_eventmode_helper_print_options_description; >+ rte_eventmode_helper_parse_args; >+ rte_eventmode_helper_initialize_devs; > }; >diff --git a/lib/librte_eventdev/rte_eventmode_helper.c >b/lib/librte_eventdev/rte_eventmode_helper.c >index 38f1a2b..d1a569b 100644 >--- a/lib/librte_eventdev/rte_eventmode_helper.c >+++ b/lib/librte_eventdev/rte_eventmode_helper.c >@@ -3,6 +3,7 @@ > */ > #include > >+#include > #include > #include > >@@ -92,7 +93,7 @@ em_initialize_helper_conf(struct >rte_eventmode_helper_conf *conf) > conf->eth_portmask =3D -1; > } > >-struct rte_eventmode_helper_conf * >+struct rte_eventmode_helper_conf * __rte_experimental > rte_eventmode_helper_parse_args(int argc, char **argv) { > int32_t opt, ret; >@@ -152,3 +153,51 @@ rte_eventmode_helper_parse_args(int argc, char >**argv) > > return NULL; > } >+ >+int32_t __rte_experimental >+rte_eventmode_helper_initialize_devs( >+ struct rte_eventmode_helper_conf *mode_conf) { >+ int ret; >+ uint16_t portid; >+ >+ if (mode_conf =3D=3D NULL) { >+ RTE_EM_HLPR_LOG_ERR("Invalid conf"); >+ return -1; >+ } >+ >+ if (mode_conf->mode !=3D >RTE_EVENTMODE_HELPER_PKT_TRANSFER_MODE_EVENT) >+ return 0; >+ >+ if (mode_conf->mode_params =3D=3D NULL) { >+ RTE_EM_HLPR_LOG_ERR("Invalid mode params"); >+ return -1; Better to return standard error number like EINVAL etc instead of having -1= or 0. Consider it for all applicable places. >+ } >+ >+ /* Stop eth devices before setting up adapter */ >+ RTE_ETH_FOREACH_DEV(portid) { >+ >+ /* Use only the ports enabled */ >+ if ((mode_conf->eth_portmask & (1 << portid)) =3D=3D 0) >+ continue; >+ >+ rte_eth_dev_stop(portid); >+ } >+ >+ /* Start eth devices after setting up adapter */ >+ RTE_ETH_FOREACH_DEV(portid) { >+ >+ /* Use only the ports enabled */ >+ if ((mode_conf->eth_portmask & (1 << portid)) =3D=3D 0) >+ continue; >+ >+ ret =3D rte_eth_dev_start(portid); >+ if (ret < 0) { >+ RTE_EM_HLPR_LOG_ERR( >+ "Error starting eth dev %d", portid); >+ return -1; >+ } >+ } >+ >+ return 0; >+} >diff --git a/lib/librte_eventdev/rte_eventmode_helper.h >b/lib/librte_eventdev/rte_eventmode_helper.h >index 77e69d0..0eafed3 100644 >--- a/lib/librte_eventdev/rte_eventmode_helper.h >+++ b/lib/librte_eventdev/rte_eventmode_helper.h >@@ -62,9 +62,33 @@ >rte_eventmode_helper_print_options_description(void); > * @return > * Configuration generated by parsing the event mode args. > */ >-struct rte_eventmode_helper_conf * >+struct rte_eventmode_helper_conf * __rte_experimental > rte_eventmode_helper_parse_args(int argc, char **argv); > >+/* Helper functions for initialization, & launching workers */ >+ >+/** >+ * Initialize event mode devices >+ * >+ * Application could call this function to get the event device, eth >+device >+ * and eth rx adapter initialized according to the conf populated using >+the >+ * command line args. >+ * >+ * Application is expected to initialize the eth device and then the >+eventmode >+ * helper subsystem will stop & start eth device according to it's requir= ement. >+ * So call to this function should be done after the eth device is >+successfully >+ * initialized. Comments should be updated for its default value of conf->eth_portmask. >+ * >+ * @param mode_conf >+ * Configuration of the mode in which app is doing packet handling >+ * @return >+ * - 0 on success. >+ * - (<0) on failure. >+ */ >+int32_t __rte_experimental >+rte_eventmode_helper_initialize_devs( >+ struct rte_eventmode_helper_conf *mode_conf); >+ > #ifdef __cplusplus > } > #endif >-- >2.7.4