Skip to content

clarify eth_dev state management

Gaetan Rivet dpdk-dev 2 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesApplied
  2. v14 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Improved patches consistency, iterator definition in one patch only

* Removed device count changes, not needed without additional device states.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3ethdev: expose device stateslib/librte_ether/rte_ethdev.c lib/librte_ether/rte_ethdev.h+14 -110 replies
2/3ethdev: add device iteratorlib/librte_ether/rte_ethdev.c lib/librte_ether/rte_ethdev.h+34 -41 reply
3/3app/testpmd: use ethdev iterator to list devicesapp/test-pmd/cmdline.c app/test-pmd/cmdline_flow.c app/test-pmd/config.c +3 more+35 -670 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] clarify eth_dev state management

1. The hotplug API currently available in DPDK introduces the notion of device states (DEV_DETACHED, DEV_ATTACHED). These states are implicit and internal to the ethdev layer.

2. Device enumeration and access is done directly, without regard to the underlying state of a device. Applications are currently expected to cycle through the static rte_eth_devices array. Those using the hotplug API (rte_eth_dev_attach(), rte_eth_dev_detach()), are thus expected to deal themselves with possible discrepancies internal to the ethdev layer, i.e. avoid detached devices if necessary, without the state of the devices having been explicitly defined or exposed.

3. The hotplug API itself is not complete and cannot be used without introducing some bugs. Detaching a device will introduce inconsistencies in the device count, as explained in the related API.
No function is exposed in the ethdev layer to permit applications to deal with it.

This series addresses these issues so that:

1. Applications are not expected to manage the states of their devices, those should be kept internal to the ethdev layer.

2. The hotplug API is cleaner, with specific operations from the ethdev layer to be used if necessary.

3. Applications that are not interested in hotplug functionality are not concerned and do not require any change.

v1 --> v2:

* Improved patches consistency, iterator definition in one patch only

* Removed device count changes, not needed without additional device states.

Gaetan Rivet (3):
ethdev: expose device states
ethdev: add device iterator
app/testpmd: use ethdev iterator to list devices

 app/test-pmd/cmdline.c        | 31 +++++++++++++++---------------
 app/test-pmd/cmdline_flow.c   |  2 +-
 app/test-pmd/config.c         | 12 ++++++------
 app/test-pmd/parameters.c     |  4 ++--
 app/test-pmd/testpmd.c        | 44 +++++++++++--------------------------------
 app/test-pmd/testpmd.h        |  9 ---------
 lib/librte_ether/rte_ethdev.c | 30 +++++++++++++++++------------
 lib/librte_ether/rte_ethdev.h | 31 ++++++++++++++++++++++++++++--
 8 files changed, 82 insertions(+), 81 deletions(-)
Signature · 1 line
2.1.4