[dpdk-dev] [PATCH v4 0/9] rte_bus parse API

Gaetan Rivet gaetan.rivet at 6wind.com
Thu Jun 8 01:56:00 CEST 2017

Following the evolutions announced in [1], here is the first part of
the rte_devargs rework planned for 17.08. The rationale has been partially
explained in [2].

This first part covers the introduction of the necessary facilities in
rte_bus to allow for generic device parsing. This API is implemented for
the virtual and PCI buses. Additionally, this rte_bus evolution is being
used within rte_devargs to characterize a device type by its bus.
This work is the first of two parts to reduce the dependency of the EAL
upon specific bus implementations.

Two public functions are added to rte_bus to help bus recognition:

- rte_bus_from_name
- rte_bus_from_dev

These functions are made public because the bus handle within devargs
becomes the generic device type. Recognizing device types is useful for
buses and PMDs alike.
The modified rte_devargs parsing allows declaring on the EAL command line
explicit buses to handle a device. The format is as follow:

  --vdev="virtual:net_ring0" --vdev="net_tap0,iface=tap0"
  -w PCI:00:02.0 -w 00:03.0

This explicit bus designation is optional; no evolution is currently
forced on users to migrate to this new format. The separating character is
arbitrary and can be any character illegal within a bus name.
Subsequently, what is allowed within a bus name has been formally
defined and is now enforced.

[1]: http://dpdk.org/ml/archives/dev/2017-May/065634.html
[2]: http://dpdk.org/ml/archives/dev/2017-May/065670.html

This patchset depends on:

bus: attach / detach API

v1 -> v2:

  * fix PCI parse implementation

v2 --> v3:

  * Rebase the series on the new plug / unplug API

v3 --> v4:

  * Several bug fixes, commit log rewrite.
  * Follow the changes to the plug / unplug API.

Gaetan Rivet (9):
  bus: fix bus name registration
  bus: verify bus name on registration
  bus: introduce parsing functionality
  vdev: implement parse bus operation
  pci: implement parse bus operation
  bus: add helper to find a bus from a bus name
  bus: add helper to find a bus from a device name
  vdev: expose bus name
  devargs: parse bus info

 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  8 +++
 lib/librte_eal/common/eal_common_bus.c          | 47 +++++++++++++++++
 lib/librte_eal/common/eal_common_devargs.c      | 17 ++++++-
 lib/librte_eal/common/eal_common_pci.c          | 19 +++++++
 lib/librte_eal/common/eal_common_vdev.c         | 68 +++++++++++++------------
 lib/librte_eal/common/eal_private.h             | 16 ++++++
 lib/librte_eal/common/include/rte_bus.h         | 49 +++++++++++++++++-
 lib/librte_eal/common/include/rte_devargs.h     |  3 ++
 lib/librte_eal/common/include/rte_vdev.h        |  2 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  8 +++
 10 files changed, 203 insertions(+), 34 deletions(-)


More information about the dev mailing list