DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v5 00/12] bus: attach / detach API
@ 2017-06-26  0:21 Gaetan Rivet
  2017-06-26  0:21 ` [dpdk-dev] [PATCH v5 01/12] bus: add bus iterator to find a bus Gaetan Rivet
                   ` (13 more replies)
  0 siblings, 14 replies; 117+ messages in thread
From: Gaetan Rivet @ 2017-06-26  0:21 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet, Jan Blunck, Shreyansh Jain, Stephen Hemminger

Following the work from Jan:

This patchset introduces the attach / detach API to rte_bus.
The rte_device structure is used as the generic device representation.

This API is implemented for the virtual bus.
The functions rte_eal_dev_attach and rte_eal_dev_detach are updated to
use this new interface.

-- v2

0. API rework
-------------

I would like to propose an evolution on the API developed by Jan.

The attach / detach rte_bus API is necessary to support the attach/detach
rte_dev API. Those are two different levels for one similar functionality.

Attach / detach does not allow true hotplugging, because the attach
function expects the devices operated upon to already exist within the
buses / sub-layers. This means that this API expects devices meta-datas
(bus-internal device representation and associated device information
read from the system) to be present upon attach. This part of the work
is done during scanning.

While it is best to avoid changing the public rte_dev API as it already
exists, nothing prevents this new rte_bus API from superseeding it.
It has been said during the previous release cycle that device hotplug
was a feature that interested users. True hotplug is not allowed by the
current attach / detach API. Worse, this API hinders the effort to bring
this new functionality by squatting its semantic field.

Thus, I propose to rename rte_bus attach / detach; plug / unplug. As it
is a superset of the attach / detach functionality, it can be used to
implement rte_dev attach / detach. Now is the right time to pivot to
this new feature.

This should help maintainers understanding the aim of this API and the
differences with the APIs higher-up, clarify the field and allow a new
functionality to be proposed.

The vdev bus is inherently supporting the new API, however it has been
made explicit. My implementation in the PCI bus in further patchset also
follows the rte_bus hotplug API instead of only attach / detach.

One remaining problem with the vdev bus is the rte_dev attach
implementation, which needs the rte_devargs rework to be properly fixed.

1. Additional evolutions in the patchset
----------------------------------------

The RTE_VERIFY on the find_device is too stringent I think and forces
all buses to implement a public device iterator. While it could be
argued that it would push for quicker support for the functionality, I
think it's possible that some buses are not interested at all in it and
should simply be ignored.

The bus devices iterator has been fixed.

The internal rte_device handle was not properly setup within the
net_ring PMD.

-- v3

The new API is now

typedef struct rte_device * (*rte_bus_plug_t)(struct rte_devargs *da);
typedef int (*rte_bus_unplug_t)(struct rte_device *dev);

So, plugging a device takes an rte_devargs as input and returns an rte_device.
While implementing related subsystems, I found that I usually needed
this rte_device handle upon a successful device plugging. This seems the
sensible and useful thing to do.
As such, on error NULL is returned and rte_errno is set by the bus.

Unplugging a device however now returns to the first version, which used
an rte_device. The explicit contract here is that if one has an
rte_device that has been obtained by calling bus->plug(), then this
handle can be used for bus->unplug().

Additionally, bus and device comparators now returns 0 on match,
following strcmp-like behavior.

-- v4

* rte_bus_find now takes a *start* parameter, that can be null.
  The bus search starts from this element if set.

* A few doc fixes.

* The rte_device field was fixed within the rte_ring PMD in a previous patch.
  This fix has been integrated by other means, it is not necessary anymore.

-- v5

* The commit
ethdev: use embedded rte_device to detach driver
  has been removed from this series to be sent separately.

* The PCI support for device access and hotplug is merged in this series
  instead of being proposed as a separate patchset.

* A few nitpicks to the code itself have been fixed.

* Some documentation has been reworked.

Gaetan Rivet (5):
  vdev: implement hotplug functionality
  vdev: expose bus name
  vdev: use standard bus registration function
  pci: implement find_device bus operation
  pci: implement hotplug bus operation

Jan Blunck (7):
  bus: add bus iterator to find a bus
  bus: add device iterator method
  bus: add helper to find which bus holds a device
  bus: add bus iterator to find a device
  bus: introduce hotplug functionality
  vdev: implement find_device bus operation
  eal: make virtual driver probe and remove take rte_vdev_device

 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |   3 +
 lib/librte_eal/common/eal_common_bus.c          |  71 ++++++++++++++
 lib/librte_eal/common/eal_common_dev.c          |  93 +++++++++++++-----
 lib/librte_eal/common/eal_common_pci.c          |  57 +++++++++++
 lib/librte_eal/common/eal_common_vdev.c         |  65 ++++++++++---
 lib/librte_eal/common/include/rte_bus.h         | 124 ++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_dev.h         |  21 ++++
 lib/librte_eal/common/include/rte_vdev.h        |   2 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |   3 +
 9 files changed, 401 insertions(+), 38 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 117+ messages in thread

end of thread, other threads:[~2017-07-03 23:17 UTC | newest]

Thread overview: 117+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26  0:21 [dpdk-dev] [PATCH v5 00/12] bus: attach / detach API Gaetan Rivet
2017-06-26  0:21 ` [dpdk-dev] [PATCH v5 01/12] bus: add bus iterator to find a bus Gaetan Rivet
2017-06-26 15:30   ` Bruce Richardson
2017-06-26 20:53     ` Gaëtan Rivet
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 02/12] bus: add device iterator method Gaetan Rivet
2017-06-26 16:20   ` Bruce Richardson
2017-06-26 21:13     ` Gaëtan Rivet
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 03/12] bus: add helper to find which bus holds a device Gaetan Rivet
2017-06-26 16:31   ` Bruce Richardson
2017-06-26 22:16     ` Gaëtan Rivet
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 04/12] bus: add bus iterator to find " Gaetan Rivet
2017-06-27 10:14   ` Bruce Richardson
2017-06-27 13:54   ` Bruce Richardson
2017-06-27 15:05     ` Gaëtan Rivet
2017-06-27 15:08       ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 05/12] bus: introduce hotplug functionality Gaetan Rivet
2017-06-27 12:23   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 06/12] vdev: implement find_device bus operation Gaetan Rivet
2017-06-27 12:25   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 07/12] vdev: implement hotplug functionality Gaetan Rivet
2017-06-27 12:41   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 08/12] vdev: expose bus name Gaetan Rivet
2017-06-27 12:45   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 09/12] vdev: use standard bus registration function Gaetan Rivet
2017-06-27 12:59   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 10/12] pci: implement find_device bus operation Gaetan Rivet
2017-06-27 13:36   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 11/12] pci: implement hotplug " Gaetan Rivet
2017-06-27 13:49   ` Bruce Richardson
2017-06-26  0:22 ` [dpdk-dev] [PATCH v5 12/12] eal: make virtual driver probe and remove take rte_vdev_device Gaetan Rivet
2017-06-27 13:58   ` Bruce Richardson
2017-06-27 14:47     ` Gaëtan Rivet
2017-06-27 15:06       ` Bruce Richardson
2017-06-27 14:00   ` Bruce Richardson
2017-06-27 14:08 ` [dpdk-dev] [PATCH v5 00/12] bus: attach / detach API Bruce Richardson
2017-06-27 14:48   ` Gaëtan Rivet
2017-06-27 16:11 ` [dpdk-dev] [PATCH v6 00/11] " Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 01/11] bus: add bus iterator to find a bus Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 02/11] bus: add device iterator method Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 03/11] bus: add helper to find which bus holds a device Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 04/11] bus: add bus iterator to find " Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 05/11] bus: introduce hotplug functionality Gaetan Rivet
2017-06-27 19:03     ` Jan Blunck
2017-06-28 11:44       ` Thomas Monjalon
2017-06-28 11:58         ` Jan Blunck
2017-06-28 12:11           ` Thomas Monjalon
2017-06-28 13:09             ` Jan Blunck
2017-06-28 13:30               ` Thomas Monjalon
2017-06-28 15:11                 ` Jan Blunck
2017-06-28 15:33                   ` Bruce Richardson
2017-06-29 12:59                     ` Gaëtan Rivet
2017-06-29 19:20                       ` Jan Blunck
2017-06-30 11:32                         ` Gaëtan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 06/11] vdev: implement find_device bus operation Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 07/11] vdev: implement hotplug " Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 08/11] vdev: use standard bus registration function Gaetan Rivet
2017-07-03 22:15     ` Thomas Monjalon
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 09/11] pci: implement find_device bus operation Gaetan Rivet
2017-06-27 23:35     ` Stephen Hemminger
2017-06-28  9:17       ` Gaëtan Rivet
2017-06-28  9:52         ` Richardson, Bruce
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 10/11] pci: implement hotplug " Gaetan Rivet
2017-06-27 16:11   ` [dpdk-dev] [PATCH v6 11/11] dev: use new hotplug API in attach / detach Gaetan Rivet
2017-06-29 18:21   ` [dpdk-dev] [PATCH 00/15] bus attach/detach API and hotplug rework Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 01/15] bus: add bus iterator to find a bus Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 02/15] bus: add find_device bus operation Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 03/15] vdev: implement " Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 04/15] pci: " Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 05/15] bus/fslmc: " Jan Blunck
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 06/15] bus: add helper to find which bus holds a device Jan Blunck
2017-06-30  9:16       ` Thomas Monjalon
2017-06-30 16:46         ` Jan Blunck
2017-06-30 18:29           ` Thomas Monjalon
2017-06-30 21:24             ` Bruce Richardson
2017-06-30 21:25           ` Bruce Richardson
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 07/15] bus: add bus iterator to find " Jan Blunck
2017-06-30  9:17       ` Thomas Monjalon
2017-06-29 18:21     ` [dpdk-dev] [PATCH v7 08/15] bus: require buses to implement find_device operation Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 09/15] bus: add rte_bus_find_by_name Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 10/15] bus: introduce device plug/unplug functionality Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 11/15] vdev: implement unplug bus operation Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 12/15] pci: implement hotplug " Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 13/15] eal: add hotplug add/remove functions Jan Blunck
2017-06-30  9:06       ` Thomas Monjalon
2017-06-30  9:11         ` Gaëtan Rivet
2017-06-30  9:20           ` Bruce Richardson
2017-06-30 15:44             ` Jan Blunck
2017-06-30 16:03               ` Thomas Monjalon
2017-06-30 16:13                 ` Gaëtan Rivet
2017-06-30 16:25                   ` Bruce Richardson
2017-06-30 16:29                     ` Thomas Monjalon
2017-06-30 12:54       ` Thomas Monjalon
2017-06-30 15:12         ` Jan Blunck
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 14/15] dev: use new hotplug API in attach / detach Jan Blunck
2017-06-29 21:05       ` Thomas Monjalon
2017-06-29 18:22     ` [dpdk-dev] [PATCH v7 15/15] ethdev: Use embedded rte_device to detach driver Jan Blunck
2017-06-29 20:58       ` Thomas Monjalon
2017-06-30  9:59     ` [dpdk-dev] [PATCH 00/15] bus attach/detach API and hotplug rework Thomas Monjalon
2017-06-30 18:19     ` [dpdk-dev] [PATCH v8 00/14] " Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 01/14] bus: add bus iterator to find a bus Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 02/14] bus: add find_device bus operation Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 03/14] vdev: implement " Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 04/14] pci: " Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 05/14] bus/fslmc: " Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 06/14] bus: add helper to find which bus holds a device Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 07/14] bus: require buses to implement find_device operation Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 08/14] bus: add rte_bus_find_by_name Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 09/14] bus: introduce device plug/unplug functionality Jan Blunck
2017-06-30 18:38         ` Gaëtan Rivet
2017-06-30 18:52           ` Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 10/14] vdev: implement unplug bus operation Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 11/14] pci: implement hotplug " Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 12/14] eal: add hotplug add/remove functions Jan Blunck
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 13/14] ethdev: Use embedded rte_device to detach driver Jan Blunck
2017-07-03 23:17         ` Thomas Monjalon
2017-06-30 18:19       ` [dpdk-dev] [PATCH v8 14/14] dev: use new hotplug API in attach Jan Blunck
2017-07-03 22:59       ` [dpdk-dev] [PATCH v8 00/14] bus attach/detach API and hotplug rework Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).