From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 61A9A1B1EB for ; Fri, 12 Apr 2019 17:48:17 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 12 Apr 2019 18:48:14 +0300 Received: from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3CFmE1O018382; Fri, 12 Apr 2019 18:48:14 +0300 From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Apr 2019 15:48:11 +0000 Message-Id: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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 15:48:18 -0000 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. Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cleanup") Signed-off-by: Viacheslav Ovsiienko --- app/test-pmd/testpmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 = NULL; if (ports[sibling].port_status != RTE_PORT_CLOSED) { -- 1.8.3.1 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 05A0AA0096 for ; Fri, 12 Apr 2019 17:48:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C380C1B1F5; Fri, 12 Apr 2019 17:48:18 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 61A9A1B1EB for ; Fri, 12 Apr 2019 17:48:17 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 12 Apr 2019 18:48:14 +0300 Received: from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3CFmE1O018382; Fri, 12 Apr 2019 18:48:14 +0300 From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Apr 2019 15:48:11 +0000 Message-Id: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190412154811.t0tWuMC7TfycGWjSX71-u_cT2R4FzAk5LW3x66MLxmE@z> 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. Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cleanup") Signed-off-by: Viacheslav Ovsiienko --- app/test-pmd/testpmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 = NULL; if (ports[sibling].port_status != RTE_PORT_CLOSED) { -- 1.8.3.1