path: root/app/proc-info
diff options
authorThomas Monjalon <>2018-04-05 17:33:20 +0200
committerThomas Monjalon <>2018-04-18 00:25:27 +0200
commit8728ccf37615904cf23fb8763895b05c9a3c6b0c (patch)
treeb6e895ec425d20d4933115f533da4be189be1f8a /app/proc-info
parenta3d6026711d00183e308f1dd79933f6161840e04 (diff)
fix ethdev ports enumeration
Some DPDK applications wrongly assume these requirements: - no hotplug, i.e. ports are never detached - all allocated ports are available to the application Such application iterates over ports by its own mean. The most common pattern is to request the port count and assume ports with index in the range [0..count[ can be used. There are three consequences when using such wrong design: - new ports having an index higher than the port count won't be seen - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application Such mistake will be less common with growing hotplug awareness. All applications and examples inside this repository - except testpmd - must be fixed to use the iterator RTE_ETH_FOREACH_DEV. Signed-off-by: Thomas Monjalon <>
Diffstat (limited to 'app/proc-info')
1 files changed, 1 insertions, 1 deletions
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index f90c144..115df9d 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -636,7 +636,7 @@ main(int argc, char **argv)
if (enabled_port_mask == 0)
enabled_port_mask = 0xffff;
- for (i = 0; i < nb_ports; i++) {
if (enabled_port_mask & (1 << i)) {
if (enable_stats)