DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 1/1] app/testpmd: fix port detach cleanup
Date: Fri, 12 Apr 2019 15:48:11 +0000	[thread overview]
Message-ID: <1555084091-24641-1-git-send-email-viacheslavo@mellanox.com> (raw)

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 <viacheslavo@mellanox.com>
---
 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

             reply	other threads:[~2019-04-12 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 15:48 Viacheslav Ovsiienko [this message]
2019-04-12 15:48 ` Viacheslav Ovsiienko
2019-04-12 19:52 ` Yongseok Koh
2019-04-12 19:52   ` Yongseok Koh
2019-04-16 16:48   ` Thomas Monjalon
2019-04-16 16:48     ` Thomas Monjalon
2019-04-16 17:05     ` Ferruh Yigit
2019-04-16 17:05       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555084091-24641-1-git-send-email-viacheslavo@mellanox.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).