From: Thomas Monjalon Date: Thu, 25 Oct 2018 15:11:15 +0000 (+0200) Subject: app/testpmd: check not configuring port twice X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=86fa5de1d8f34f0d5849d16edb33f7633c604367;p=dpdk.git app/testpmd: check not configuring port twice 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 Acked-by: Bernard Iremonger --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index dd6e6eacd4..5706686fc5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2300,8 +2300,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