From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VaiUy7rh9x0yGvLDnfEduX/XJmDKEfbvYbIDzwhyC2E=; b=n9vSMbHfdU56HAeVAfuDoj5GwS6blQj4g7oAMc1XTu3UM94joOjwzyZphm/U7WgqXkzP6K9gpGabQU05hD2IKDcaLdTWkLTQ7kH2sik9QmGqCQIn+vFwBY+aZI3CZiV+mlq5QJ4wSZB5jqcb4zrB3RMQB5p7BiLfQw+VjE/ZQdg= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3217.eurprd05.prod.outlook.com (10.171.186.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Wed, 3 Apr 2019 15:04:26 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1750.021; Wed, 3 Apr 2019 15:04:26 +0000 From: Slava Ovsiienko To: Thomas Monjalon , "gaetan.rivet@6wind.com" , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thread-Index: AQHU6DKFkzgJ+y2fDUq0kwlg30iZXqYqjJtQ 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> In-Reply-To: <20190401022700.1570-5-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ea85ddb-3d0b-4345-3d12-08d6b845aa20 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3217; x-ms-traffictypediagnostic: AM4PR05MB3217: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0996D1900D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(136003)(39860400002)(396003)(199004)(189003)(13464003)(316002)(66066001)(186003)(5660300002)(6506007)(76176011)(256004)(97736004)(14444005)(7696005)(53546011)(305945005)(476003)(33656002)(14454004)(71200400001)(446003)(11346002)(99286004)(52536014)(6116002)(71190400001)(53936002)(6436002)(68736007)(81156014)(486006)(8936002)(106356001)(26005)(110136005)(478600001)(102836004)(81166006)(105586002)(86362001)(25786009)(2906002)(7736002)(2501003)(74316002)(3846002)(229853002)(55016002)(9686003)(4326008)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3217; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 77iuxmTnKiv8X4bVx3FnJZkSdYMYW7yg1GIHWIORBr20nbwCRh5t+vI348Ov4xAwvq9I++JHDACvDWu2ekGlgkl0mNhazj7jMvRqPQNTOAGYeTuk7XOrJEjhauinwbqeP/iiWnnmhZf84B1r5eEDKXkbCJqRA0prhdEFiCHexNT9UsGeWNYWq1xy5PuL+s1T5UtsfXy/9m+0BP8p6MDH3jL1UVM8duen7e/8croWdihI0wzRJ3pHXgkIfK0dQr6eqNnAATZTpDv6N0kw99AXYnH60tYBQbiE61Y8KN8WP/+0KVMZmXnbEGkjP2Lxeygz/jWRxgkvlWv+bF1V0G79SVxnJnsZtKFEjJLyPJL9UivxMQFa1tv4ezBQveRncu7VYW7WWo8oY4Z/Itq9nrdtQwQ+jkGSHQzMWmGbour/mEk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ea85ddb-3d0b-4345-3d12-08d6b845aa20 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2019 15:04:26.4806 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3217 Subject: Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup 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: Wed, 03 Apr 2019 15:04:27 -0000 > -----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 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 F1BE5A0679 for ; Wed, 3 Apr 2019 17:04:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 989BC1B49A; Wed, 3 Apr 2019 17:04:29 +0200 (CEST) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VaiUy7rh9x0yGvLDnfEduX/XJmDKEfbvYbIDzwhyC2E=; b=n9vSMbHfdU56HAeVAfuDoj5GwS6blQj4g7oAMc1XTu3UM94joOjwzyZphm/U7WgqXkzP6K9gpGabQU05hD2IKDcaLdTWkLTQ7kH2sik9QmGqCQIn+vFwBY+aZI3CZiV+mlq5QJ4wSZB5jqcb4zrB3RMQB5p7BiLfQw+VjE/ZQdg= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3217.eurprd05.prod.outlook.com (10.171.186.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Wed, 3 Apr 2019 15:04:26 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1750.021; Wed, 3 Apr 2019 15:04:26 +0000 From: Slava Ovsiienko To: Thomas Monjalon , "gaetan.rivet@6wind.com" , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thread-Index: AQHU6DKFkzgJ+y2fDUq0kwlg30iZXqYqjJtQ 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> In-Reply-To: <20190401022700.1570-5-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ea85ddb-3d0b-4345-3d12-08d6b845aa20 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3217; x-ms-traffictypediagnostic: AM4PR05MB3217: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0996D1900D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(136003)(39860400002)(396003)(199004)(189003)(13464003)(316002)(66066001)(186003)(5660300002)(6506007)(76176011)(256004)(97736004)(14444005)(7696005)(53546011)(305945005)(476003)(33656002)(14454004)(71200400001)(446003)(11346002)(99286004)(52536014)(6116002)(71190400001)(53936002)(6436002)(68736007)(81156014)(486006)(8936002)(106356001)(26005)(110136005)(478600001)(102836004)(81166006)(105586002)(86362001)(25786009)(2906002)(7736002)(2501003)(74316002)(3846002)(229853002)(55016002)(9686003)(4326008)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3217; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 77iuxmTnKiv8X4bVx3FnJZkSdYMYW7yg1GIHWIORBr20nbwCRh5t+vI348Ov4xAwvq9I++JHDACvDWu2ekGlgkl0mNhazj7jMvRqPQNTOAGYeTuk7XOrJEjhauinwbqeP/iiWnnmhZf84B1r5eEDKXkbCJqRA0prhdEFiCHexNT9UsGeWNYWq1xy5PuL+s1T5UtsfXy/9m+0BP8p6MDH3jL1UVM8duen7e/8croWdihI0wzRJ3pHXgkIfK0dQr6eqNnAATZTpDv6N0kw99AXYnH60tYBQbiE61Y8KN8WP/+0KVMZmXnbEGkjP2Lxeygz/jWRxgkvlWv+bF1V0G79SVxnJnsZtKFEjJLyPJL9UivxMQFa1tv4ezBQveRncu7VYW7WWo8oY4Z/Itq9nrdtQwQ+jkGSHQzMWmGbour/mEk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ea85ddb-3d0b-4345-3d12-08d6b845aa20 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2019 15:04:26.4806 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3217 Subject: Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup 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" Message-ID: <20190403150426.4LjqUetSqFG50nOkLaqk_Vv8JyjSe1fDxX3qC--coLA@z> > -----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