fix ethdev ports enumeration
authorThomas Monjalon <thomas@monjalon.net>
Thu, 5 Apr 2018 15:33:20 +0000 (17:33 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 17 Apr 2018 22:25:27 +0000 (00:25 +0200)
commit8728ccf37615904cf23fb8763895b05c9a3c6b0c
treeb6e895ec425d20d4933115f533da4be189be1f8a
parenta3d6026711d00183e308f1dd79933f6161840e04
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 <thomas@monjalon.net>
109 files changed:
app/proc-info/main.c
app/test-eventdev/test_perf_common.c
app/test-eventdev/test_pipeline_common.c
app/test-pmd/cmdline.c
app/test-pmd/testpmd.c
doc/guides/sample_app_ug/flow_classify.rst
doc/guides/sample_app_ug/l2_forward_job_stats.rst
doc/guides/sample_app_ug/l2_forward_real_virtual.rst
doc/guides/sample_app_ug/link_status_intr.rst
doc/guides/sample_app_ug/skeleton.rst
drivers/net/bonding/Makefile
drivers/net/bonding/meson.build
drivers/net/bonding/rte_eth_bond_args.c
drivers/net/mvpp2/mrvl_ethdev.c
examples/bond/Makefile
examples/bond/main.c
examples/bond/meson.build
examples/distributor/Makefile
examples/distributor/main.c
examples/distributor/meson.build
examples/ethtool/ethtool-app/Makefile
examples/ethtool/ethtool-app/ethapp.c
examples/eventdev_pipeline/main.c
examples/eventdev_pipeline/pipeline_worker_generic.c
examples/eventdev_pipeline/pipeline_worker_tx.c
examples/exception_path/Makefile
examples/exception_path/main.c
examples/exception_path/meson.build
examples/flow_classify/flow_classify.c
examples/ip_fragmentation/Makefile
examples/ip_fragmentation/main.c
examples/ip_fragmentation/meson.build
examples/ip_reassembly/Makefile
examples/ip_reassembly/main.c
examples/ip_reassembly/meson.build
examples/ipsec-secgw/ipsec-secgw.c
examples/ipv4_multicast/Makefile
examples/ipv4_multicast/main.c
examples/ipv4_multicast/meson.build
examples/kni/Makefile
examples/kni/main.c
examples/kni/meson.build
examples/l2fwd-cat/Makefile
examples/l2fwd-cat/l2fwd-cat.c
examples/l2fwd-cat/meson.build
examples/l2fwd-crypto/Makefile
examples/l2fwd-crypto/main.c
examples/l2fwd-crypto/meson.build
examples/l2fwd-jobstats/Makefile
examples/l2fwd-jobstats/main.c
examples/l2fwd-jobstats/meson.build
examples/l2fwd-keepalive/Makefile
examples/l2fwd-keepalive/main.c
examples/l2fwd-keepalive/meson.build
examples/l2fwd/Makefile
examples/l2fwd/main.c
examples/l2fwd/meson.build
examples/l3fwd-acl/Makefile
examples/l3fwd-acl/main.c
examples/l3fwd-acl/meson.build
examples/l3fwd-power/Makefile
examples/l3fwd-power/main.c
examples/l3fwd-power/meson.build
examples/l3fwd-vf/Makefile
examples/l3fwd-vf/main.c
examples/l3fwd-vf/meson.build
examples/l3fwd/Makefile
examples/l3fwd/main.c
examples/l3fwd/meson.build
examples/multi_process/l2fwd_fork/Makefile
examples/multi_process/l2fwd_fork/main.c
examples/multi_process/symmetric_mp/Makefile
examples/multi_process/symmetric_mp/main.c
examples/packet_ordering/Makefile
examples/packet_ordering/main.c
examples/packet_ordering/meson.build
examples/performance-thread/l3fwd-thread/Makefile
examples/performance-thread/l3fwd-thread/main.c
examples/ptpclient/Makefile
examples/ptpclient/meson.build
examples/ptpclient/ptpclient.c
examples/rxtx_callbacks/Makefile
examples/rxtx_callbacks/main.c
examples/rxtx_callbacks/meson.build
examples/skeleton/Makefile
examples/skeleton/basicfwd.c
examples/skeleton/meson.build
examples/tep_termination/Makefile
examples/tep_termination/main.c
examples/tep_termination/meson.build
examples/vhost/Makefile
examples/vhost/main.c
examples/vhost/meson.build
examples/vm_power_manager/Makefile
examples/vm_power_manager/channel_monitor.c
examples/vm_power_manager/main.c
examples/vmdq/Makefile
examples/vmdq/main.c
examples/vmdq/meson.build
examples/vmdq_dcb/Makefile
examples/vmdq_dcb/main.c
examples/vmdq_dcb/meson.build
lib/librte_eventdev/rte_event_eth_rx_adapter.c
lib/librte_latencystats/Makefile
lib/librte_latencystats/meson.build
lib/librte_latencystats/rte_latencystats.c
test/test/test_event_eth_rx_adapter.c
test/test/test_pmd_perf.c
test/test/test_pmd_ring.c