DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
To: Jan Blunck <jblunck@infradead.org>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 3/8] devargs: introduce insert function
Date: Wed, 12 Jul 2017 19:20:18 +0200	[thread overview]
Message-ID: <20170712172018.GD11154@bidouze.vm.6wind.com> (raw)
In-Reply-To: <CALe+Z00v70JMp2WOTOcGeQ7G9ESZ85sK7XTouKcVsgLKd_kDOg@mail.gmail.com>

On Wed, Jul 12, 2017 at 04:20:48AM -0400, Jan Blunck wrote:
> On Tue, Jul 11, 2017 at 7:25 PM, Gaetan Rivet <gaetan.rivet@6wind.com> wrote:
> > Some buses will operate either in whitelist or blacklist mode.
> > This mode is currently passed down by the rte_eal_devargs_add function
> > with the devtype argument.
> >
> > When inserting devices using the hotplug API, the implicit assumption is
> > that this device is being whitelisted, meaning that it is explicitly
> > requested by the application to be used. This can conflict with the
> > initial bus configuration.
> 
> Actually I don't think that this is correct. If I blacklist a device
> via devargs I don't want this to be probed in case my udev helper is
> calling hotplug add.
> 

This would be good for a udev handler yes. But should we expect this
behavior from all potential hotplug initiators?

To put it another way: should this rule be enforced at the EAL level or
from those using it? And is it impossible to imagine a system that would
actually need to be able to update a device, changing it from
blacklisted to whitelisted on some specific condition?

The fail-safe at least makes use of this ability. This is at the moment
the only hotplug user.

> Maybe it is better to just update the args field in case the devargs
> instance is already found.
> 
> >
> > While the rte_eal_devargs_add API is being deprecated soon, it cannot
> > be modified at the moment to accomodate this situation.
> > As such, this new experimental API offers a bare interface for inserting
> > rte_devargs without directly manipulating the global rte_devargs list.
> >
> > This new function expects a fully-formed rte_devargs, previously parsed
> > and allocated.
> >
> > It does not check whether the new rte_devargs is compatible with current
> > bus configuration, but will replace any eventual existing one for the same
> > device, allowing the hotplug operation to proceed. i.e. a previously
> > blacklisted device can be redefined as being whitelisted.
> >
> > Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> > ---
> >  lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 +
> >  lib/librte_eal/common/eal_common_devargs.c      | 12 ++++++++++++
> >  lib/librte_eal/common/include/rte_devargs.h     | 13 +++++++++++++
> >  lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
> >  4 files changed, 27 insertions(+)
> >
> > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> > index 40cd523..8b24309 100644
> > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> > @@ -206,6 +206,7 @@ DPDK_17.08 {
> >  EXPERIMENTAL {
> >         global:
> >
> > +       rte_eal_devargs_insert;
> >         rte_eal_devargs_parse;
> >         rte_eal_devargs_remove;
> >         rte_eal_hotplug_add;
> > diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
> > index bcdee13..ff6c2a8 100644
> > --- a/lib/librte_eal/common/eal_common_devargs.c
> > +++ b/lib/librte_eal/common/eal_common_devargs.c
> > @@ -138,6 +138,18 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
> >         return 0;
> >  }
> >
> > +int
> > +rte_eal_devargs_insert(struct rte_devargs *da)
> > +{
> > +       int ret;
> > +
> > +       ret = rte_eal_devargs_remove(da->bus->name, da->name);
> > +       if (ret < 0)
> > +               return ret;
> > +       TAILQ_INSERT_TAIL(&devargs_list, da, next);
> > +       return 0;
> > +}
> > +
> >  /* store a whitelist parameter for later parsing */
> >  int
> >  rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
> > diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h
> > index 36453b6..7b63fa3 100644
> > --- a/lib/librte_eal/common/include/rte_devargs.h
> > +++ b/lib/librte_eal/common/include/rte_devargs.h
> > @@ -139,6 +139,19 @@ rte_eal_devargs_parse(const char *dev,
> >                       struct rte_devargs *da);
> >
> >  /**
> > + * Insert an rte_devargs in the global list.
> > + *
> > + * @param da
> > + *  The devargs structure to insert.
> > + *
> > + * @return
> > + *   - 0 on success
> > + *   - Negative on error.
> > + */
> > +int
> > +rte_eal_devargs_insert(struct rte_devargs *da);
> > +
> > +/**
> >   * Add a device to the user device list
> >   *
> >   * For PCI devices, the format of arguments string is "PCI_ADDR" or
> > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> > index a8ee349..81f6af3 100644
> > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> > @@ -211,6 +211,7 @@ DPDK_17.08 {
> >  EXPERIMENTAL {
> >         global:
> >
> > +       rte_eal_devargs_insert;
> >         rte_eal_devargs_parse;
> >         rte_eal_devargs_remove;
> >         rte_eal_hotplug_add;
> > --
> > 2.1.4
> >

-- 
Gaëtan Rivet
6WIND

  reply	other threads:[~2017-07-12 17:20 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09  1:45 [dpdk-dev] [PATCH 0/9] fix hotplug API Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 1/9] eal: return device handle upon plugin Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 2/9] eal: fix hotplug add Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 3/9] devargs: introduce removal function Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 4/9] eal: release devargs on device removal Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 5/9] pci: use given name as generic name Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 6/9] pci: fix generic driver pointer on probe error Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 7/9] pci: fix hotplug operations Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 8/9] vdev: implement plug operation Gaetan Rivet
2017-07-09  1:45 ` [dpdk-dev] [PATCH 9/9] bus: remove useless plug parameter Gaetan Rivet
2017-07-09 10:38 ` [dpdk-dev] [PATCH 0/9] fix hotplug API Jan Blunck
2017-07-09 12:19   ` Gaëtan Rivet
2017-07-09 14:19   ` Thomas Monjalon
     [not found]     ` <20170711160211.GW11154@bidouze.vm.6wind.com>
     [not found]       ` <CALe+Z00Rc_6cn_ckWrK1cD2RsdWENM3s+ytOpxNymTmaqh8e0g@mail.gmail.com>
2017-07-11 19:21         ` Gaëtan Rivet
2017-07-10 23:18 ` [dpdk-dev] [PATCH v2 0/8] " Gaetan Rivet
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 1/8] vdev: implement plug operation Gaetan Rivet
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 2/8] devargs: introduce removal function Gaetan Rivet
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 3/8] devargs: introduce insert function Gaetan Rivet
2017-07-11 22:13     ` Thomas Monjalon
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 4/8] eal: fix hotplug add / remove Gaetan Rivet
2017-07-11 22:18     ` Thomas Monjalon
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 5/8] pci: use given name as generic name Gaetan Rivet
2017-07-11 22:05     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 6/8] pci: fix generic driver pointer on probe error Gaetan Rivet
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 7/8] pci: fix hotplug operations Gaetan Rivet
2017-07-10 23:19   ` [dpdk-dev] [PATCH v2 8/8] bus: remove useless plug parameter Gaetan Rivet
2017-07-11 23:25   ` [dpdk-dev] [PATCH v3 0/8] fix hotplug API Gaetan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 1/8] vdev: implement plug operation Gaetan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 2/8] devargs: introduce removal function Gaetan Rivet
2017-07-12  8:27       ` Jan Blunck
2017-07-12 17:22         ` Gaëtan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 3/8] devargs: introduce insert function Gaetan Rivet
2017-07-12  8:20       ` Jan Blunck
2017-07-12 17:20         ` Gaëtan Rivet [this message]
2017-07-13 19:44           ` Jan Blunck
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 4/8] eal: fix hotplug add / remove Gaetan Rivet
2017-07-12  8:44       ` Jan Blunck
2017-07-12 17:33         ` Gaëtan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 5/8] pci: use given name as generic name Gaetan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 6/8] pci: fix generic driver pointer on probe error Gaetan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 7/8] pci: fix hotplug operations Gaetan Rivet
2017-07-11 23:25     ` [dpdk-dev] [PATCH v3 8/8] bus: remove useless plug parameter Gaetan Rivet
2017-07-15 17:56     ` [dpdk-dev] [PATCH v4 0/8] fix hotplug API Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 1/8] vdev: implement plug operation Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 2/8] devargs: introduce removal function Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 3/8] devargs: introduce insert function Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 4/8] eal: fix hotplug add / remove Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 5/8] pci: use given name as generic name Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 6/8] pci: fix generic driver pointer on probe error Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 7/8] pci: fix hotplug operations Gaetan Rivet
2017-07-15 17:56       ` [dpdk-dev] [PATCH v4 8/8] bus: remove useless plug parameter Gaetan Rivet
2017-07-19 21:27       ` [dpdk-dev] [PATCH v4 0/8] fix hotplug API 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=20170712172018.GD11154@bidouze.vm.6wind.com \
    --to=gaetan.rivet@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jblunck@infradead.org \
    /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 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).