All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@infradead.org>
To: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>, dev <dev@dpdk.org>
Subject: Re: [PATCH v6 05/11] bus: introduce hotplug functionality
Date: Thu, 29 Jun 2017 21:20:30 +0200	[thread overview]
Message-ID: <CALe+Z00oW12072C=RMboCiK4LkxK1=Zezp4+B2XNjYxr0rSeGg@mail.gmail.com> (raw)
In-Reply-To: <20170629125940.GL13355@bidouze.vm.6wind.com>

On Thu, Jun 29, 2017 at 2:59 PM, Gaëtan Rivet <gaetan.rivet@6wind.com> wrote:
>
> Hi all,
>
> We are all for having "true" hotplug support in DPDK.
> By true hotplug, it means that at some point, a new device exists on the
> system, while the DPDK bus on which it should be probed does not yet
> have its metadata. Something needs to be done to retrieve these metadata,
> one way or another.
>
> What I see as a solution to this:
>
> - An interrupt framework integrated to rte_bus, allowing drivers to
>   describe interrupt sources (Kernel UEVENT, custom FDs, ...), to their
>   buses.
>
> - Applications should be able to pilot these interrupts for rte_bus
>   (either in describing expected devices, or allowing actions to be
>   taken upon device removal).
>
> - Buses could take the responsibility of plugging in and out their own
>   devices, once properly configured.
>

This is highly application dependent and it is up to the application
developer to decide when such events are getting processed. There is a
major difference between the data path functionality that support
interrupts and the processing of hotplug events. So from my
perspective it needs to be left as an exercise to the programmer to
add the polling of the /sysfs files into the event loop. We might
offer an example of how to do this though.

> In this context, it is possible to imagine triggering a bus-rescan upon
> device ADD, iff we explicitly define scan() as being idempotent (a thing
> that is not part of its API yet and that we cannot expect from buses at
> this point).

Hmm, so from what I can tell the PCI bus offers an idempotent scan()
and if I haven't added any bugs this is true for the virtual bus too.

> Then, we can limit bus->plug() to a probe, once we are sure that
> metadatas for the bus are (almost) always in sync with the system.
>
> Where we are:
>
> - Intel is proposing a UEVENT API[1]. It might be interesting to help them
>   make it respect a generic framework.

Just because you can do it and someone invested time doesn't mean its
a good idea. What problem is this solving? You now have a DPDK native
library that reads uevents ... Where is the benefit for the
application developer?

Although we replicate some components of an operating system in
userspace it doesn't mean that we are building one. If we don't push
back on things that don't belong here we will have a big pile of
average code soon instead of focusing on the technical problems that
need to get addressed.

> - A first plug / unplug implementation is being proposed. Plug() is
>   currently effectively defined as (scan-one + probe).
>
> What can be done to go forward:
>
> - Define the API for rte_bus interrupt sources, configuration and
>   triggers to allow the development of the needed subsystems.
>
> - Each device event sources should offer an event parser to transform
>   them in device descriptions. Depending on the specifics of the source,
>   different levels of info are available.
>
> - Redefine the requirements for bus->scan() to allow hotplugging.
>
> - Reduce the scope of plug() from (scan-one + probe) to (probe), as
>   everything is now in place.
>

Also see the series that I send out today. From my point of view we
are here already.

> - Further hotplugging developments are then possible: add INTR_ADD
>   support, with flexible device definition for example... A thing that
>   is not yet possible with the current architecture but seemed to
>   interest a few people.
>
> If we can agree that this is a way forward, do you think Jan that having
> the current plug() API hinders this plan? We can reduce its scope later,
> without changing current implementations as, as you said, a proper
> scan should be idempotent. The future API as envisionned is already
> respected, but right now the hotplug support in buses is a little more
> involved. Applications that will start using plug() right now would not
> have to be rewritten, as the requirements for plugging would still be
> fullfilled.
>
> We can support already hotplugging in DPDK. We can refine this support
> later to make it more generic and easier to implement for PMD
> maintainers. But I do not see this as a reason to block this support
> from being integrated right now.

Indeed. I had hotplug support in the version of DPDK that I'm working
with for the last years. Don't get me wrong: I'm not arguing against
the inclusion of hotplug code. I just don't understand the reasoning
behind the implementation you proposed (with my original SOB)
especially since some of the things that you listed as going forward
are already there, are easy to fix or don't necessarily need to be
part of the DPDK EAL.

So lets try to get this right from the beginning. What is missing:
1. document and verify that existing scan() implementations are idempotent
2. example app with udev based hotplug
3. check that the symbols are in the correct libraries (bus, pci, vdev)

What am I missing?

> [1]: http://dpdk.org/ml/archives/dev/2017-June/069057.html
>
> --
> Gaėtan Rivet
> 6WIND

  reply	other threads:[~2017-06-29 19:20 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26  0:21 [PATCH v5 00/12] bus: attach / detach API Gaetan Rivet
2017-06-26  0:21 ` [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 ` [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 ` [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 ` [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 ` [PATCH v5 05/12] bus: introduce hotplug functionality Gaetan Rivet
2017-06-27 12:23   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 06/12] vdev: implement find_device bus operation Gaetan Rivet
2017-06-27 12:25   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 07/12] vdev: implement hotplug functionality Gaetan Rivet
2017-06-27 12:41   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 08/12] vdev: expose bus name Gaetan Rivet
2017-06-27 12:45   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 09/12] vdev: use standard bus registration function Gaetan Rivet
2017-06-27 12:59   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 10/12] pci: implement find_device bus operation Gaetan Rivet
2017-06-27 13:36   ` Bruce Richardson
2017-06-26  0:22 ` [PATCH v5 11/12] pci: implement hotplug " Gaetan Rivet
2017-06-27 13:49   ` Bruce Richardson
2017-06-26  0:22 ` [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 ` [PATCH v5 00/12] bus: attach / detach API Bruce Richardson
2017-06-27 14:48   ` Gaëtan Rivet
2017-06-27 16:11 ` [PATCH v6 00/11] " Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 01/11] bus: add bus iterator to find a bus Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 02/11] bus: add device iterator method Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 03/11] bus: add helper to find which bus holds a device Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 04/11] bus: add bus iterator to find " Gaetan Rivet
2017-06-27 16:11   ` [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 [this message]
2017-06-30 11:32                         ` Gaëtan Rivet
2017-06-27 16:11   ` [PATCH v6 06/11] vdev: implement find_device bus operation Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 07/11] vdev: implement hotplug " Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 08/11] vdev: use standard bus registration function Gaetan Rivet
2017-07-03 22:15     ` Thomas Monjalon
2017-06-27 16:11   ` [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   ` [PATCH v6 10/11] pci: implement hotplug " Gaetan Rivet
2017-06-27 16:11   ` [PATCH v6 11/11] dev: use new hotplug API in attach / detach Gaetan Rivet
2017-06-29 18:21   ` [PATCH 00/15] bus attach/detach API and hotplug rework Jan Blunck
2017-06-29 18:21     ` [PATCH v7 01/15] bus: add bus iterator to find a bus Jan Blunck
2017-06-29 18:21     ` [PATCH v7 02/15] bus: add find_device bus operation Jan Blunck
2017-06-29 18:21     ` [PATCH v7 03/15] vdev: implement " Jan Blunck
2017-06-29 18:21     ` [PATCH v7 04/15] pci: " Jan Blunck
2017-06-29 18:21     ` [PATCH v7 05/15] bus/fslmc: " Jan Blunck
2017-06-29 18:21     ` [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     ` [PATCH v7 07/15] bus: add bus iterator to find " Jan Blunck
2017-06-30  9:17       ` Thomas Monjalon
2017-06-29 18:21     ` [PATCH v7 08/15] bus: require buses to implement find_device operation Jan Blunck
2017-06-29 18:22     ` [PATCH v7 09/15] bus: add rte_bus_find_by_name Jan Blunck
2017-06-29 18:22     ` [PATCH v7 10/15] bus: introduce device plug/unplug functionality Jan Blunck
2017-06-29 18:22     ` [PATCH v7 11/15] vdev: implement unplug bus operation Jan Blunck
2017-06-29 18:22     ` [PATCH v7 12/15] pci: implement hotplug " Jan Blunck
2017-06-29 18:22     ` [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     ` [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     ` [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     ` [PATCH 00/15] bus attach/detach API and hotplug rework Thomas Monjalon
2017-06-30 18:19     ` [PATCH v8 00/14] " Jan Blunck
2017-06-30 18:19       ` [PATCH v8 01/14] bus: add bus iterator to find a bus Jan Blunck
2017-06-30 18:19       ` [PATCH v8 02/14] bus: add find_device bus operation Jan Blunck
2017-06-30 18:19       ` [PATCH v8 03/14] vdev: implement " Jan Blunck
2017-06-30 18:19       ` [PATCH v8 04/14] pci: " Jan Blunck
2017-06-30 18:19       ` [PATCH v8 05/14] bus/fslmc: " Jan Blunck
2017-06-30 18:19       ` [PATCH v8 06/14] bus: add helper to find which bus holds a device Jan Blunck
2017-06-30 18:19       ` [PATCH v8 07/14] bus: require buses to implement find_device operation Jan Blunck
2017-06-30 18:19       ` [PATCH v8 08/14] bus: add rte_bus_find_by_name Jan Blunck
2017-06-30 18:19       ` [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       ` [PATCH v8 10/14] vdev: implement unplug bus operation Jan Blunck
2017-06-30 18:19       ` [PATCH v8 11/14] pci: implement hotplug " Jan Blunck
2017-06-30 18:19       ` [PATCH v8 12/14] eal: add hotplug add/remove functions Jan Blunck
2017-06-30 18:19       ` [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       ` [PATCH v8 14/14] dev: use new hotplug API in attach Jan Blunck
2017-07-03 22:59       ` [PATCH v8 00/14] bus attach/detach API and hotplug rework Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALe+Z00oW12072C=RMboCiK4LkxK1=Zezp4+B2XNjYxr0rSeGg@mail.gmail.com' \
    --to=jblunck@infradead.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.