From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81D4DA04F3; Fri, 3 Jan 2020 14:53:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A99F41D410; Fri, 3 Jan 2020 14:53:15 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 9224F1D40E for ; Fri, 3 Jan 2020 14:53:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2020 05:53:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="252596095" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 03 Jan 2020 05:53:12 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jan 2020 05:53:12 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jan 2020 05:53:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+5Ee0oOJinruLEWGZ9lzms9c51UHlRkyOG3RUB7FTHq/O8YDGQOPOeZTIHunKox3EwMtMrnPNWdIB/wfL79yiBdBDJWN01a81MJVxRWulNCClMj0TyrSa1R5A97G4WUtkt2XK8n7uNhx8EgGdO2leyHB4EwG0/raP29R5Qasy9LCwZ9ueyTp2c0gxOuZ1fDcuOR8I0bDZGGh4pqaxBlFiiijJ8awzBR0oS0gPLVmL54d3C5laSTcYwHA/MHvnA9ECIL85EdMKD9FC1KIGIJKPxpWnlWRVtkLmzlPIkycfpKqioJmlRsZgxLiawYaXR5BH9/qgg3wT7xjZqgf2DeJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v8Ri/4rrKLq+ZV3scaW7i8qDoCByLF6J2TGgMcv+zm4=; b=e3RMaUtV/w7HhSac8o2YoDKMIpHBxXAP7gRyu0AMtT/0CPdG+HbewOV8LdvMte2TT9qNG192OxgRrngeqC6WBXDKqFAslXT4Pbve5F0AHSpSGsMvOm+ocJtuPejJUDjAHu5IuteAToSm47mIM5kMVpmYJ3E+Cqw8NIU3Oz0WUQitdYgJ+qzAgjLsp8Izx1upHjEK8zZzGua1x46uwlqhGyHrg+2l2i4YPbqtkTdEndwStXmB1BxvwXFprYxmfz+qpWeIVrgZSSdQZgE4o1z8k8zaJDUINhRbDaZ0EdIPG/5uBJu90Tq4EJOvLZjiJdoDA9ueRHB0U8zF1e3F/Tl7cA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v8Ri/4rrKLq+ZV3scaW7i8qDoCByLF6J2TGgMcv+zm4=; b=cVSHSYIywL/zIOWiPEHp/f6+qbn3hb9wUDOnfC0arX09R4QQ8PcGoQ+d07dteBuFXWyPF2egjf2XjW9Lqj1NkRhJu8zg63j7FlibFpsktGjOlBpLQ0ZR5TQUFr8Hcjz32ObAh70bCbJbGqls9OfoPsVjMUb2PNdCRkt12v8PZ5c= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB2560.namprd11.prod.outlook.com (52.135.90.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Fri, 3 Jan 2020 13:52:57 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 13:52:57 +0000 From: "Ananyev, Konstantin" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "Kovacevic, Marko" , Ori Kam , "Richardson, Bruce" , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 10/11] examples/l3fwd: add graceful teardown for eventdevice Thread-Index: AQHVqrGefZ9Gifd9VUeR+8DHIvNnTqfZI/rA Date: Fri, 3 Jan 2020 13:52:56 +0000 Message-ID: References: <20191204144345.5736-1-pbhagavatula@marvell.com> <20191204144345.5736-11-pbhagavatula@marvell.com> In-Reply-To: <20191204144345.5736-11-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDkxZWI1N2EtMzNkYi00YWI1LWIxMjgtZGExNWZlOWEwNjQwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRmhFeUNyaFdzQ29DREJEa0Z4cnBlajZpUVFQXC9mOWUxTVlhUFJucVBsb1d6bHFiZE9lQmFQTmluMnpEY0JLUW8ifQ== dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.189] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d2bcbea-534c-4a0a-4122-08d790543cf3 x-ms-traffictypediagnostic: SN6PR11MB2560: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:206; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39860400002)(346002)(366004)(376002)(189003)(199004)(5660300002)(8936002)(7696005)(52536014)(9686003)(66476007)(86362001)(478600001)(6506007)(81156014)(33656002)(81166006)(55016002)(110136005)(26005)(4326008)(66946007)(76116006)(64756008)(316002)(66446008)(186003)(66556008)(71200400001)(2906002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB2560; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IwgCuPVZcxT89/oTpCPSxNLt2YL5/OEA706eMSeMNR7Ct4Xp5X/4LFkMclcmY57ypYKhAYOtE491+HVHNAMD1t+N8bc/3Np8Za9zDKYC7QyPengeTGUmAw+ElfFpWQs1YpIMLFugoYFiSRCoXVzcGHmgQq/RK+90mXok5jfQ5kgBDuWZiPpYqy+sCOXtpzZStQ65v/tJ725KERhSDc56LRvbBlSpvi0A1sMH0Bt2TfgC4nJ8jziJulPS9cq4YeR6J3ZsIbvHJeBs+mNmc6jv0BCQv6lHDTjecK2IcxSiPdT+Ua9S1FWWPngG2A1F/ys6EJeMAdQssTWJ2PiecBQY1GhsHKpeQJqXmuc36Cd3CrpLQ8JG6Btj9P7EjupjZsqtFId3ER8e5LsOoYC7qziNE8UfatURk6mD0Tg/WLhSL8q2bC3Ivnx/AsRmwJmxaoSkfOtUCk6JFxnUAqWrEecpnm+Ot1BIvH8gnJYQMPrCxvSHQ/5GTkNl6EMnr93NZRW/ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2bcbea-534c-4a0a-4122-08d790543cf3 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 13:52:56.9012 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: j+AObClPmaI1kRySRfAcyYtuWLZXS3fGctufly8ss0aAZMqhcA3jqFcX7DeReWv01b6JGCDu5FSYlEoTyrPDR9IFx/K8VZvlZh0vAo0AN/Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2560 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 10/11] examples/l3fwd: add graceful teardown for eventdevice 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" > Add graceful teardown that addresses both event mode and poll mode. >=20 > Signed-off-by: Pavan Nikhilesh > --- > examples/l3fwd/main.c | 49 ++++++++++++++++++++++++++++++------------- > 1 file changed, 34 insertions(+), 15 deletions(-) >=20 > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > index 0ae64dd41..68998f42c 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -920,7 +920,7 @@ main(int argc, char **argv) > struct lcore_conf *qconf; > struct rte_eth_dev_info dev_info; > struct rte_eth_txconf *txconf; > - int ret; > + int i, ret; > unsigned nb_ports; > uint16_t queueid, portid; > unsigned lcore_id; > @@ -1195,27 +1195,46 @@ main(int argc, char **argv) > } > } >=20 > - > check_all_ports_link_status(enabled_port_mask); >=20 > ret =3D 0; > /* launch per-lcore init on every lcore */ > rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MASTER); > - RTE_LCORE_FOREACH_SLAVE(lcore_id) { > - if (rte_eal_wait_lcore(lcore_id) < 0) { > - ret =3D -1; > - break; > + if (evt_rsrc->enabled) { > + for (i =3D 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++) > + rte_event_eth_rx_adapter_stop( > + evt_rsrc->rx_adptr.rx_adptr[i]); > + for (i =3D 0; i < evt_rsrc->tx_adptr.nb_tx_adptr; i++) > + rte_event_eth_tx_adapter_stop( > + evt_rsrc->tx_adptr.tx_adptr[i]); > + > + RTE_ETH_FOREACH_DEV(portid) { > + if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > + continue; > + rte_eth_dev_stop(portid); > } > - } >=20 > - /* stop ports */ > - RTE_ETH_FOREACH_DEV(portid) { > - if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > - continue; > - printf("Closing port %d...", portid); > - rte_eth_dev_stop(portid); > - rte_eth_dev_close(portid); > - printf(" Done\n"); Why to stop ports *before* making sure all lcores are stopped? Shouldn't that peace of code be identical for both poll and event mode? Something like: rte_eal_mp_wait_lcore(); RTE_ETH_FOREACH_DEV(portid) { if ((enabled_port_mask & (1 << portid)) =3D=3D 0) continue; rte_eth_dev_stop(portid); rte_eth_dev_close(portid); } ? > + rte_eal_mp_wait_lcore(); > + RTE_ETH_FOREACH_DEV(portid) { > + if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > + continue; > + rte_eth_dev_close(portid); > + } > + > + rte_event_dev_stop(evt_rsrc->event_d_id); > + rte_event_dev_close(evt_rsrc->event_d_id); > + > + } else { > + rte_eal_mp_wait_lcore(); > + > + RTE_ETH_FOREACH_DEV(portid) { > + if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > + continue; > + printf("Closing port %d...", portid); > + rte_eth_dev_stop(portid); > + rte_eth_dev_close(portid); > + printf(" Done\n"); > + } > } > printf("Bye...\n"); >=20 > -- > 2.17.1