From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id E31421CCA3 for ; Thu, 5 Apr 2018 17:33:32 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5FEE620CEB; Thu, 5 Apr 2018 11:33:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 05 Apr 2018 11:33:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=vrLeWmULgiTWtD /nVFVXdJR3jvhoOxWM9UKZ9/nYBXU=; b=XDoBmBKbRd4ZiV9L5D9690c76AZX1R 2J26nnWtxP9N9JaUL2e7mUXMyF0xs8266jONdN+wdzYr/LZh4HYtYKLgFpSVY59w 0mTSjY4eNO588IZ2pRPM70Xq0SMpoSabnxypRszgg/xB/cmplYT5xGllTQF22qOd yBfR3dM1rzMwc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=vrLeWmULgiTWtD/nVFVXdJR3jvhoOxWM9UKZ9/nYBXU=; b=Y/PPCcW8 ii/v2Qc1WmukRtvK7A1Nd9N+4bfF76BE0fIVig10F7cJpyeCR5wdTIDq9BqncFX8 yj49H4S8TvB/dDOQRHtRNVH9jdIB0zcX9HVq7BaOiuxKahFuez2m2OqtdZnPdu+E gsMQFvWHnxxUyiaEO1OEVuCGdx/A/YjPJUAokD2jBVwWUVs0yohOnwKDbu2s+1s5 w8SkeTJWMlSvH5Xm1Xy6WSYvBAlJbmMfe5mH+g3YDNDflts7jVIrl/osqOJLidTZ x9+uEirSa8WyzgGazwpKkWWcUcP4Y0vjMXh/nUnpz4ftAGbP0oBZQdCm5EsZB24O RCFCUaFynGqEVw== X-ME-Sender: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BBDE8E4449; Thu, 5 Apr 2018 11:33:31 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 5 Apr 2018 17:33:19 +0200 Message-Id: <20180405153322.5488-1-thomas@monjalon.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180309222255.27663-1-thomas@monjalon.net> References: <20180309222255.27663-1-thomas@monjalon.net> Subject: [dpdk-dev] [PATCH v2 0/3] ethdev: fix ports enumeration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:33:33 -0000 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, and to use the function rte_eth_dev_is_valid_port. In order to fix this common mistake in all external applications, the function rte_eth_dev_count is deprecated, while introducing the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total. -- The RFC was sent one month ago with only couple of apps updated. V2 does the same change with all apps updated. Thomas Monjalon (3): fix ethdev ports enumeration fix ethdev port id validation ethdev: deprecate port count function app/pdump/main.c | 3 +- app/proc-info/main.c | 4 +- app/test-eventdev/test_perf_atq.c | 2 +- app/test-eventdev/test_perf_common.c | 12 ++--- app/test-eventdev/test_perf_queue.c | 2 +- app/test-eventdev/test_pipeline_atq.c | 4 +- app/test-eventdev/test_pipeline_common.c | 16 +++--- app/test-eventdev/test_pipeline_queue.c | 6 +-- app/test-pmd/cmdline.c | 57 ++-------------------- app/test-pmd/testpmd.c | 13 ++--- doc/guides/rel_notes/release_18_05.rst | 7 +++ doc/guides/sample_app_ug/flow_classify.rst | 14 ++---- doc/guides/sample_app_ug/kernel_nic_interface.rst | 10 ---- doc/guides/sample_app_ug/l2_forward_job_stats.rst | 7 +-- .../sample_app_ug/l2_forward_real_virtual.rst | 7 +-- doc/guides/sample_app_ug/link_status_intr.rst | 6 +-- doc/guides/sample_app_ug/quota_watermark.rst | 2 +- doc/guides/sample_app_ug/rxtx_callbacks.rst | 3 -- doc/guides/sample_app_ug/skeleton.rst | 11 ++--- drivers/net/bonding/Makefile | 1 + drivers/net/bonding/meson.build | 2 + drivers/net/bonding/rte_eth_bond_args.c | 4 +- drivers/net/mvpp2/mrvl_ethdev.c | 2 +- examples/bbdev_app/main.c | 10 ++-- examples/bond/Makefile | 3 ++ examples/bond/main.c | 8 +-- examples/bond/meson.build | 1 + examples/distributor/Makefile | 3 ++ examples/distributor/main.c | 29 ++++++----- examples/distributor/meson.build | 1 + examples/ethtool/ethtool-app/Makefile | 1 + examples/ethtool/ethtool-app/ethapp.c | 10 ++-- examples/ethtool/ethtool-app/main.c | 2 +- examples/eventdev_pipeline/main.c | 25 +++++----- .../eventdev_pipeline/pipeline_worker_generic.c | 7 ++- examples/eventdev_pipeline/pipeline_worker_tx.c | 6 +-- examples/exception_path/Makefile | 3 ++ examples/exception_path/main.c | 10 ++-- examples/exception_path/meson.build | 1 + examples/flow_classify/flow_classify.c | 17 +++---- examples/flow_filtering/Makefile | 3 ++ examples/flow_filtering/main.c | 4 +- examples/flow_filtering/meson.build | 1 + examples/ip_fragmentation/Makefile | 3 ++ examples/ip_fragmentation/main.c | 14 +++--- examples/ip_fragmentation/meson.build | 1 + examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/Makefile | 3 ++ examples/ip_reassembly/main.c | 12 ++--- examples/ip_reassembly/meson.build | 1 + examples/ipsec-secgw/ipsec-secgw.c | 24 ++++----- examples/ipv4_multicast/Makefile | 3 ++ examples/ipv4_multicast/main.c | 10 ++-- examples/ipv4_multicast/meson.build | 1 + examples/kni/Makefile | 3 ++ examples/kni/main.c | 24 ++++----- examples/kni/meson.build | 1 + examples/l2fwd-cat/Makefile | 2 + examples/l2fwd-cat/l2fwd-cat.c | 11 ++--- examples/l2fwd-cat/meson.build | 1 + examples/l2fwd-crypto/Makefile | 3 ++ examples/l2fwd-crypto/main.c | 22 ++++----- examples/l2fwd-crypto/meson.build | 1 + examples/l2fwd-jobstats/Makefile | 4 +- examples/l2fwd-jobstats/main.c | 21 ++++---- examples/l2fwd-jobstats/meson.build | 1 + examples/l2fwd-keepalive/Makefile | 3 ++ examples/l2fwd-keepalive/main.c | 21 ++++---- examples/l2fwd-keepalive/meson.build | 1 + examples/l2fwd/Makefile | 3 ++ examples/l2fwd/main.c | 23 +++++---- examples/l2fwd/meson.build | 1 + examples/l3fwd-acl/Makefile | 3 ++ examples/l3fwd-acl/main.c | 18 +++---- examples/l3fwd-acl/meson.build | 1 + examples/l3fwd-power/Makefile | 3 ++ examples/l3fwd-power/main.c | 23 +++++---- examples/l3fwd-power/meson.build | 1 + examples/l3fwd-vf/Makefile | 3 ++ examples/l3fwd-vf/main.c | 15 +++--- examples/l3fwd-vf/meson.build | 1 + examples/l3fwd/Makefile | 3 ++ examples/l3fwd/main.c | 20 ++++---- examples/l3fwd/meson.build | 1 + examples/link_status_interrupt/Makefile | 3 ++ examples/link_status_interrupt/main.c | 2 +- examples/link_status_interrupt/meson.build | 1 + .../client_server_mp/mp_client/Makefile | 1 + .../client_server_mp/mp_client/client.c | 2 +- .../client_server_mp/mp_server/Makefile | 1 + .../client_server_mp/mp_server/init.c | 2 +- examples/multi_process/l2fwd_fork/Makefile | 1 + examples/multi_process/l2fwd_fork/main.c | 24 +++++---- examples/multi_process/symmetric_mp/Makefile | 1 + examples/multi_process/symmetric_mp/main.c | 8 +-- examples/netmap_compat/bridge/Makefile | 1 + examples/netmap_compat/bridge/bridge.c | 2 +- examples/packet_ordering/Makefile | 3 ++ examples/packet_ordering/main.c | 27 +++++----- examples/packet_ordering/meson.build | 1 + examples/performance-thread/l3fwd-thread/Makefile | 1 + examples/performance-thread/l3fwd-thread/main.c | 18 +++---- examples/ptpclient/Makefile | 3 ++ examples/ptpclient/meson.build | 1 + examples/ptpclient/ptpclient.c | 6 +-- examples/qos_sched/Makefile | 3 ++ examples/qos_sched/init.c | 2 +- examples/qos_sched/meson.build | 1 + examples/quota_watermark/qw/Makefile | 1 + examples/quota_watermark/qw/init.c | 2 +- examples/rxtx_callbacks/Makefile | 3 ++ examples/rxtx_callbacks/main.c | 13 +++-- examples/rxtx_callbacks/meson.build | 1 + examples/server_node_efd/node/Makefile | 1 + examples/server_node_efd/node/node.c | 2 +- examples/server_node_efd/server/Makefile | 1 + examples/server_node_efd/server/init.c | 2 +- examples/skeleton/Makefile | 3 ++ examples/skeleton/basicfwd.c | 11 ++--- examples/skeleton/meson.build | 3 ++ examples/tep_termination/Makefile | 3 ++ examples/tep_termination/main.c | 11 ++--- examples/tep_termination/meson.build | 1 + examples/tep_termination/vxlan_setup.c | 2 +- examples/vhost/Makefile | 3 ++ examples/vhost/main.c | 14 +++--- examples/vhost/meson.build | 1 + examples/vm_power_manager/Makefile | 1 + examples/vm_power_manager/channel_monitor.c | 5 +- examples/vm_power_manager/main.c | 12 ++--- examples/vmdq/Makefile | 3 ++ examples/vmdq/main.c | 12 ++--- examples/vmdq/meson.build | 1 + examples/vmdq_dcb/Makefile | 3 ++ examples/vmdq_dcb/main.c | 12 ++--- examples/vmdq_dcb/meson.build | 1 + lib/librte_ether/rte_ethdev.c | 25 ++++++++-- lib/librte_ether/rte_ethdev.h | 23 +++++++++ lib/librte_ether/rte_ethdev_version.map | 4 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 13 ++--- lib/librte_kni/rte_kni.c | 4 +- lib/librte_latencystats/Makefile | 1 + lib/librte_latencystats/meson.build | 1 + lib/librte_latencystats/rte_latencystats.c | 6 +-- test/test/test_event_eth_rx_adapter.c | 10 ++-- test/test/test_kni.c | 2 +- test/test/test_link_bonding_mode4.c | 2 +- test/test/test_link_bonding_rssconf.c | 2 +- test/test/test_pmd_perf.c | 6 +-- test/test/test_pmd_ring.c | 4 +- 150 files changed, 530 insertions(+), 470 deletions(-) -- 2.16.2