From: Thomas Monjalon <thomas@monjalon.net>
To: bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com
Cc: dev@dpdk.org, ophirmu@mellanox.com, wisamm@mellanox.com,
ferruh.yigit@intel.com, arybchenko@solarflare.com
Subject: [dpdk-dev] [PATCH 3/5] app/testpmd: check not configuring port twice
Date: Wed, 24 Oct 2018 15:41:09 +0200 [thread overview]
Message-ID: <20181024134111.26771-4-thomas@monjalon.net> (raw)
In-Reply-To: <20181024134111.26771-1-thomas@monjalon.net>
It is possible to request probing of a device twice,
and possibly get new ports for this device.
However, the ports which were already probed and setup
must not be setup again. That's why it is checked whether
the port is already part of fwd_ports_ids array at the beginning
of the function setup_attached_port().
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/testpmd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 21627ecb6..72b91adf5 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2295,8 +2295,11 @@ attach_port(char *identifier)
return;
}
- RTE_ETH_FOREACH_MATCHING_DEV(pi, identifier, &iterator)
+ RTE_ETH_FOREACH_MATCHING_DEV(pi, identifier, &iterator) {
+ if (port_is_forwarding(pi))
+ continue; /* port was already attached before */
setup_attached_port(pi);
+ }
}
static void
--
2.19.0
next prev parent reply other threads:[~2018-10-24 13:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 13:41 [dpdk-dev] [PATCH 0/5] app/testpmd: improve attach/detach support Thomas Monjalon
2018-10-24 13:41 ` [dpdk-dev] [PATCH 1/5] app/testpmd: check not detaching device twice Thomas Monjalon
2018-10-24 15:38 ` Iremonger, Bernard
2018-10-24 13:41 ` [dpdk-dev] [PATCH 2/5] app/testpmd: merge ports list update functions Thomas Monjalon
2018-10-24 15:45 ` Iremonger, Bernard
2018-10-24 13:41 ` Thomas Monjalon [this message]
2018-10-24 15:50 ` [dpdk-dev] [PATCH 3/5] app/testpmd: check not configuring port twice Iremonger, Bernard
2018-10-24 13:41 ` [dpdk-dev] [PATCH 4/5] app/testpmd: move ethdev events registration Thomas Monjalon
2018-10-24 15:55 ` Iremonger, Bernard
2018-10-24 19:55 ` Thomas Monjalon
2018-10-25 8:54 ` Iremonger, Bernard
2018-10-25 8:58 ` Thomas Monjalon
2018-10-24 13:41 ` [dpdk-dev] [PATCH 5/5] app/testpmd: setup attached ports on probe event Thomas Monjalon
2018-10-24 16:13 ` Iremonger, Bernard
2018-10-24 19:57 ` Thomas Monjalon
2018-10-25 8:58 ` Iremonger, Bernard
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 0/5] app/testpmd: improve attach/detach support Thomas Monjalon
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 1/5] app/testpmd: check not detaching device twice Thomas Monjalon
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 2/5] app/testpmd: merge ports list update functions Thomas Monjalon
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: check not configuring port twice Thomas Monjalon
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: move ethdev events registration Thomas Monjalon
2018-10-25 16:05 ` Iremonger, Bernard
2018-10-25 15:11 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: setup attached ports on probe event Thomas Monjalon
2018-10-25 16:07 ` Iremonger, Bernard
2018-10-26 12:46 ` [dpdk-dev] [PATCH v2 0/5] app/testpmd: improve attach/detach support 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=20181024134111.26771-4-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=arybchenko@solarflare.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jingjing.wu@intel.com \
--cc=ophirmu@mellanox.com \
--cc=wenzhuo.lu@intel.com \
--cc=wisamm@mellanox.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).