From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140043.outbound.protection.outlook.com [40.107.14.43]) by dpdk.org (Postfix) with ESMTP id 894231B1E8 for ; Fri, 12 Apr 2019 21:52:21 +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=XC5ZP6QCK3yxMUaeIHvl8S6eEYApcub/HsEhyyJnw/Y=; b=O/Ph/vIVKH5UXJT0HpiJMnakv/lLDuQHLHEY/s11QvIR7sY6cC4nL8tMQ6Et7JCRhLTr6sIPPujRyXY6h7nU0jj7kHzTr2tZZxWds9KfX3JDKcFGQTtFP1i81hibqWwcfKvcMgZz1Zb5nK6js7A6zCW6HC6Shk7CR/4vPe6Qbu4= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4059.eurprd05.prod.outlook.com (52.134.66.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Fri, 12 Apr 2019 19:52:20 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a%3]) with mapi id 15.20.1792.009; Fri, 12 Apr 2019 19:52:20 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: dev , "ferruh.yigit@intel.com" Thread-Topic: [dpdk-dev] [PATCH 1/1] app/testpmd: fix port detach cleanup Thread-Index: AQHU8UcrQexxUqXnx0u9mVOuwZ00sKY47+qA Date: Fri, 12 Apr 2019 19:52:20 +0000 Message-ID: References: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> 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=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ae0e494-f90b-4b06-0cda-08d6bf805fa7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB4059; x-ms-traffictypediagnostic: DB3PR0502MB4059: x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(189003)(199004)(476003)(6636002)(6512007)(105586002)(71190400001)(106356001)(71200400001)(66066001)(83716004)(6246003)(33656002)(97736004)(6436002)(305945005)(4326008)(7736002)(6862004)(53936002)(256004)(25786009)(6486002)(82746002)(36756003)(81156014)(86362001)(316002)(14454004)(81166006)(6116002)(2906002)(229853002)(446003)(54906003)(8676002)(3846002)(478600001)(8936002)(37006003)(99286004)(76176011)(68736007)(486006)(6506007)(2616005)(26005)(186003)(5660300002)(11346002)(102836004)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4059; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: hOvlq73fWa8v3RVYBY7fr7fm8CSG8crgsbGAF8jqw16x95hsArf+jBOCBYh171Qnv6rMGPRW3dOZSx/CK2W/q7BLMf55Q7EEfJgJJJYzG46Zle/6CThPm8ZWmdX+RN6C4fBnC6+XVQqK8m66OYyY2T4SypYra4FK/h8UpGGyfMlf8A1ZkRbtSCbH6AYZW8wxWkle6CWgEWIJHaKYPvMxpr+dCHPOyWoB9V1Fk549oBt4yqx1FmvAClD3S/ptVmCS0PoPCuS/CBphaeyBMfgSGJEvgSATbS6SupYgEEv2Jrqo1mwDU2DTspLqVH6YtaV1wunuIqHmxY6FtfdBaHPuvMEqnCIzTtzvykfAL59WhWJnVgFvBXF5Evl09DojmUbHXAxX1sQOjX20G9Ps3XJ3QTsrjAFP0rvPZVQOFSvzXVs= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ae0e494-f90b-4b06-0cda-08d6bf805fa7 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 19:52:20.0135 (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: DB3PR0502MB4059 Subject: Re: [dpdk-dev] [PATCH 1/1] app/testpmd: fix port detach 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: Fri, 12 Apr 2019 19:52:21 -0000 > On Apr 12, 2019, at 8:48 AM, Viacheslav Ovsiienko wrote: >=20 > At port detach routine after calling the rte_dev_remove() > testpmd performs some cleanup, checking the statuses of > remaining ports and closes the appropriate ones. The port > scanning is based on the new sibling iterator which uses the > invalid (already closed) port for reference. This patch > replaces the foreach iterator and uses the device object for > reference. It is worth to note this cleanup is not needed > for some drivers (at least for mlx5 and probably for others) > and is preserved due to possible compatibility issues. >=20 > Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cl= eanup") >=20 > Signed-off-by: Viacheslav Ovsiienko > --- Acked-by: Yongseok Koh > app/test-pmd/testpmd.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index aeaa74c..739f96e 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2369,8 +2369,7 @@ struct extmem_param { > TESTPMD_LOG(ERR, "Failed to detach device %s\n", dev->name); > return; > } > - > - RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) { > + RTE_ETH_FOREACH_DEV_OF(sibling, dev) { > /* reset mapping between old ports and removed device */ > rte_eth_devices[sibling].device =3D NULL; > if (ports[sibling].port_status !=3D RTE_PORT_CLOSED) { > --=20 > 1.8.3.1 >=20 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 94BF8A0096 for ; Fri, 12 Apr 2019 21:52:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA6A61B213; Fri, 12 Apr 2019 21:52:23 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140043.outbound.protection.outlook.com [40.107.14.43]) by dpdk.org (Postfix) with ESMTP id 894231B1E8 for ; Fri, 12 Apr 2019 21:52:21 +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=XC5ZP6QCK3yxMUaeIHvl8S6eEYApcub/HsEhyyJnw/Y=; b=O/Ph/vIVKH5UXJT0HpiJMnakv/lLDuQHLHEY/s11QvIR7sY6cC4nL8tMQ6Et7JCRhLTr6sIPPujRyXY6h7nU0jj7kHzTr2tZZxWds9KfX3JDKcFGQTtFP1i81hibqWwcfKvcMgZz1Zb5nK6js7A6zCW6HC6Shk7CR/4vPe6Qbu4= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4059.eurprd05.prod.outlook.com (52.134.66.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Fri, 12 Apr 2019 19:52:20 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a%3]) with mapi id 15.20.1792.009; Fri, 12 Apr 2019 19:52:20 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: dev , "ferruh.yigit@intel.com" Thread-Topic: [dpdk-dev] [PATCH 1/1] app/testpmd: fix port detach cleanup Thread-Index: AQHU8UcrQexxUqXnx0u9mVOuwZ00sKY47+qA Date: Fri, 12 Apr 2019 19:52:20 +0000 Message-ID: References: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> 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=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ae0e494-f90b-4b06-0cda-08d6bf805fa7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB4059; x-ms-traffictypediagnostic: DB3PR0502MB4059: x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(189003)(199004)(476003)(6636002)(6512007)(105586002)(71190400001)(106356001)(71200400001)(66066001)(83716004)(6246003)(33656002)(97736004)(6436002)(305945005)(4326008)(7736002)(6862004)(53936002)(256004)(25786009)(6486002)(82746002)(36756003)(81156014)(86362001)(316002)(14454004)(81166006)(6116002)(2906002)(229853002)(446003)(54906003)(8676002)(3846002)(478600001)(8936002)(37006003)(99286004)(76176011)(68736007)(486006)(6506007)(2616005)(26005)(186003)(5660300002)(11346002)(102836004)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4059; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: hOvlq73fWa8v3RVYBY7fr7fm8CSG8crgsbGAF8jqw16x95hsArf+jBOCBYh171Qnv6rMGPRW3dOZSx/CK2W/q7BLMf55Q7EEfJgJJJYzG46Zle/6CThPm8ZWmdX+RN6C4fBnC6+XVQqK8m66OYyY2T4SypYra4FK/h8UpGGyfMlf8A1ZkRbtSCbH6AYZW8wxWkle6CWgEWIJHaKYPvMxpr+dCHPOyWoB9V1Fk549oBt4yqx1FmvAClD3S/ptVmCS0PoPCuS/CBphaeyBMfgSGJEvgSATbS6SupYgEEv2Jrqo1mwDU2DTspLqVH6YtaV1wunuIqHmxY6FtfdBaHPuvMEqnCIzTtzvykfAL59WhWJnVgFvBXF5Evl09DojmUbHXAxX1sQOjX20G9Ps3XJ3QTsrjAFP0rvPZVQOFSvzXVs= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ae0e494-f90b-4b06-0cda-08d6bf805fa7 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 19:52:20.0135 (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: DB3PR0502MB4059 Subject: Re: [dpdk-dev] [PATCH 1/1] app/testpmd: fix port detach 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: <20190412195220.L3NTJqoIs4l4xpMvfMmwl_wha25nP9fRCmGiR7KpJwU@z> > On Apr 12, 2019, at 8:48 AM, Viacheslav Ovsiienko wrote: >=20 > At port detach routine after calling the rte_dev_remove() > testpmd performs some cleanup, checking the statuses of > remaining ports and closes the appropriate ones. The port > scanning is based on the new sibling iterator which uses the > invalid (already closed) port for reference. This patch > replaces the foreach iterator and uses the device object for > reference. It is worth to note this cleanup is not needed > for some drivers (at least for mlx5 and probably for others) > and is preserved due to possible compatibility issues. >=20 > Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cl= eanup") >=20 > Signed-off-by: Viacheslav Ovsiienko > --- Acked-by: Yongseok Koh > app/test-pmd/testpmd.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index aeaa74c..739f96e 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2369,8 +2369,7 @@ struct extmem_param { > TESTPMD_LOG(ERR, "Failed to detach device %s\n", dev->name); > return; > } > - > - RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) { > + RTE_ETH_FOREACH_DEV_OF(sibling, dev) { > /* reset mapping between old ports and removed device */ > rte_eth_devices[sibling].device =3D NULL; > if (ports[sibling].port_status !=3D RTE_PORT_CLOSED) { > --=20 > 1.8.3.1 >=20