From mboxrd@z Thu Jan 1 00:00:00 1970 From: Slava Ovsiienko Subject: Re: [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Date: Wed, 3 Apr 2019 15:04:26 +0000 Message-ID: References: <20181130002716.27325-1-thomas@monjalon.net> <20190401022700.1570-1-thomas@monjalon.net> <20190401022700.1570-5-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Thomas Monjalon , "gaetan.rivet@6wind.com" , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Return-path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150057.outbound.protection.outlook.com [40.107.15.57]) by dpdk.org (Postfix) with ESMTP id 5AB4E1B49A for ; Wed, 3 Apr 2019 17:04:27 +0200 (CEST) In-Reply-To: <20190401022700.1570-5-thomas@monjalon.net> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Thomas Monjalon > Sent: Monday, April 1, 2019 5:27 > To: gaetan.rivet@6wind.com; Wenzhuo Lu ; Jingjing > Wu ; Bernard Iremonger > > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator= in > device cleanup >=20 > When removing a rte_device on a port-based request, all the sibling ports > must be marked as closed. > The iterator loop can be simplified by using the dedicated macro. >=20 > Signed-off-by: Thomas Monjalon Tested-by: Viacheslav Ovsiienko > --- > app/test-pmd/testpmd.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 40c873b97..aeaa74c98 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id) > return; > } >=20 > - for (sibling =3D 0; sibling < RTE_MAX_ETHPORTS; sibling++) { > - if (rte_eth_devices[sibling].device !=3D dev) > - continue; > + RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) { > /* reset mapping between old ports and removed device */ > rte_eth_devices[sibling].device =3D NULL; > if (ports[sibling].port_status !=3D RTE_PORT_CLOSED) { > -- > 2.21.0