DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org, Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	techboard@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 00/13] introduce fail-safe PMD
Date: Thu, 16 Mar 2017 16:50:43 -0400	[thread overview]
Message-ID: <20170316205043.GA4472@hmswarspite.think-freely.org> (raw)
In-Reply-To: <20170315142537.GR908@bidouze.vm.6wind.com>

On Wed, Mar 15, 2017 at 03:25:37PM +0100, Gaëtan Rivet wrote:
> On Wed, Mar 15, 2017 at 12:15:56PM +0100, Thomas Monjalon wrote:
> > 2017-03-15 03:28, Bruce Richardson:
> > > On Tue, Mar 14, 2017 at 03:49:47PM +0100, Gaëtan Rivet wrote:
> > > > - In the bonding, the init and configuration steps are still the
> > > >  responsibility of the application and no one else. The bonding PMD
> > > >  captures the device, re-applies its configuration upon dev_configure()
> > > >  which is actually re-applying part of the configuration already  present
> > > > within the slave eth_dev (cf rte_eth_dev_config_restore).
> > > >
> > > > - In the fail-safe, the init and configuration are both the
> > > >  responsibilities of the fail-safe PMD itself, not the application
> > > >  anymore. This handling of these responsibilities in lieu of the
> > > >  application is the whole point of the "deferred hot-plug" support, of
> > > >  proposing a simple implementation to the user.
> > > >
> > > > This change in responsibilities is the bulk of the fail-safe code. It
> > > > would have to be added as-is to the bonding. Verifying the correctness
> > > > of the sync of the initialization phase (acceptable states of a device
> > > > following several events registered by the fail-safe PMD) and the
> > > > configuration items between the state the application believes it is in
> > > > and the fail-safe knows it is in, is the bulk of the fail-safe code.
> > > >
> > > > This function is not overlapping with that of the bonding. The reason I
> > > > did not add this whole architecture to the bonding is that when I tried
> > > > to do so, I found that I only had two possibilities:
> > > >
> > > > - The current slave handling path is kept, and we only add a new one
> > > >  with additional functionalities: full init and conf handling with
> > > >  extended parsing capabilities.
> > > >
> > > > - The current slave handling is scraped and replaced entirely by the new
> > > >  slave management. The old capturing of existing device is not done
> > > >  anymore.
> > > >
> > > > The first solution is not acceptable, because we effectively end-up with
> > > > a maintenance nightmare by having to validate two types of slaves with
> > > > differing capabilities, differing initialization paths and differing
> > > > configuration code.  This is extremely awkward and architecturally
> > > > unsound. This is essentially the same as having the exact code of the
> > > > fail-safe as an aside in the bonding, maintening exactly the same
> > > > breadth of code while having muddier interfaces and organization.
> > > >
> > > > The second solution is not acceptable, because we are bending the whole
> > > > existing bonding API to our whim. We could just as well simply rename
> > > > the fail-safe PMD as bonding, add a few grouping capabilities and call
> > > > it a day. This is not acceptable for users.
> > > >
> > > If the first solution is indeed not an option, why do you think this
> > > second one would be unacceptable for users? If the functionality remains
> > > the same, I don't see how it matters much for users which driver
> > > provides it or where the code originates.
> > > 
> 
> The problem with the second solution is also that bonding is not only a PMD.
> It exposes its own public API that existing applications rely on, see
> rte_eth_bond_*() definitions in rte_eth_bond.h.
> 
> Although bonding instances can be set up through command-line options,
> target "users" are mainly applications explicitly written to use it.
> This must be preserved for no other reason that it hasn't been deprecated.
> 
I fail to see how either of your points are relevant.  The fact that the bonding
pmd exposes an api to the application has no bearing on its ability to implement
a hot plug function.

> Also, trying to implement this API for the device failover function would
> implies a device capture down to the devargs parsing level. This means that
> a PMD could request taking over a device, messing with the internals of the
> EAL: devargs list and busses lists of devices. This seems unacceptable.
> 
Why?  You just said yourself above that, while there is a devargs interface to
the bonding driver, there is also an api, which is the more used method to
configure bonding.  I'm not sure I agree with that, but I think its beside the
point.  Your PMD also requires configuration, and it appears necessecary that
you do so from the command line (you need to specifically ennumerate the
subdevices that you intend to provide failsafe behavior to).  I see no reason
why such a feature cant' be added to bonding, and the null pmd used as a
standin device, should the ennumerated device not yet exist).

To your argument regarding about taking over a device, I don't see how you find
that unacceptable, as it is precisely what the bonding driver does today, in the
sense that it allows an application to assign a master/slave relationship to
devices right now.  I see no reason that we can't convey the right and ability
for bonding to do that dynamically based on configuration.

> The bonding API is thus in conflict with the concept of a device failover in
> the context of the current DPDK arch.
> 
I really don't see how you get to this from your argument above.

> > > Despite all the discussion, it still just doesn't make sense to me to
> > > have more than one DPDK driver to handle failover - be it link or
> > > device. If nothing else, it's going to be awkward to explain to users
> > > that if they want fail-over for when a link goes down they have to use
> > > driver A, but if they want fail-over when a NIC gets hotplugged they use
> > > driver B, and if they want both kinds of failover - which would surely
> > > be the expected case - they need to use both drivers. The usability is
> > > a problem here.
> 
> Having both kind of failovers in the same PMD will always lead to the first
> solution in some form or another.
> 
It really isn't because you can model hotplug behavior as a trival form of the
failover that bonding does now (i.e. failover between a null device and a
preferred real device).

> I am sure we can document all this in a way that does no cause users
> confusion, with the help of community feedback such as yours.
> 
> Perhaps "net_failsafe" is a misnomer? We also thought about "net_persistent"
> or "net_hotplug". Any other ideas?
> 
> It is also possible for me to remove the failover support from this series,
> only providing deferred hot-plug handling at first. I could then send the
> failover support as separate patches to better assert that it is a useful,
> secondary feature that is essentially free to implement.
> 
I think thats solving the wrong problem.  I've no issue with the functionality
in this patch, its really the implementation that we are all arguing against.

> > 
> > It seems everybody agrees on the need for the failsafe code.
> > We are just discussing the right place to implement it.
> > 
> > Gaetan, moving this code in the bonding PMD means replacing the bonding
> > API design by the failsafe design, right?
> > With the failsafe design in the bonding PMD, is it possible to keep other
> > bonding features?
> 
> As seen previously, the bonding API is incompatible with device failover.
> 
Its not been seen previously, you asserted it to be so, and I certainly disagree
with that assertion.  I think others might too.

Additionally, its not really in line with this discussion, but in looking at
your hotplug detection code, I think somewhat lacking.  Currently you seem to
implement this with a timer that wakes up and checks for device existance, which
is pretty substandard in my mind.  Thats going to waste cpu cycles that might
lead to packet loss.  I'd really prefer to see you augment the eal library with
an event handling code (it can tie into udev in linux and kqueue in bsd), and
create a generic event hook, that we can use to detect device adds/removes
without having to wake up constantly to see if anything has changed.


> Having some features enabled solely for one kind of failover, while having
> specific code paths for both, seems unecessarily complicated to me ;
> following suite with my previous points about the first solution.
> 
> > 
> > In case we do not have a consensus in the following days, I suggest to add
> > this topic in the next techboard meeting agenda.
> 
> Regards,
> -- 
> Gaëtan Rivet
> 6WIND
> 

  reply	other threads:[~2017-03-16 20:51 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 15:40 [dpdk-dev] [PATCH 00/12] " Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 01/12] ethdev: save VLAN filter setting Gaetan Rivet
2017-03-03 17:33   ` Stephen Hemminger
2017-03-03 15:40 ` [dpdk-dev] [PATCH 02/12] ethdev: add flow API rule copy function Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 03/12] ethdev: add deferred intermediate device state Gaetan Rivet
2017-03-03 17:34   ` Stephen Hemminger
2017-03-03 15:40 ` [dpdk-dev] [PATCH 04/12] pci: expose device detach routine Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 05/12] pci: expose parse and probe routines Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 06/12] net/failsafe: add fail-safe PMD Gaetan Rivet
2017-03-03 17:38   ` Stephen Hemminger
2017-03-06 14:19     ` Gaëtan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 07/12] net/failsafe: add plug-in support Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 08/12] net/failsafe: add flexible device definition Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 09/12] net/failsafe: support flow API Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 10/12] net/failsafe: support offload capabilities Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 11/12] net/failsafe: add fast burst functions Gaetan Rivet
2017-03-03 15:40 ` [dpdk-dev] [PATCH 12/12] net/failsafe: support device removal Gaetan Rivet
2017-03-03 16:14 ` [dpdk-dev] [PATCH 00/12] introduce fail-safe PMD Bruce Richardson
2017-03-06 13:53   ` Gaëtan Rivet
2017-03-03 17:27 ` Stephen Hemminger
2017-03-08 15:15 ` [dpdk-dev] [PATCH v2 00/13] " Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 01/13] ethdev: save VLAN filter setting Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 02/13] ethdev: add flow API rule copy function Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 03/13] ethdev: add deferred intermediate device state Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 04/13] pci: expose device detach routine Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 05/13] pci: expose parse and probe routines Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 06/13] net/failsafe: add fail-safe PMD Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 07/13] net/failsafe: add plug-in support Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 08/13] net/failsafe: add flexible device definition Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 09/13] net/failsafe: support flow API Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 10/13] net/failsafe: support offload capabilities Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 11/13] net/failsafe: add fast burst functions Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 12/13] net/failsafe: support device removal Gaetan Rivet
2017-03-08 15:15   ` [dpdk-dev] [PATCH v2 13/13] net/failsafe: support link status change event Gaetan Rivet
2017-03-08 16:54   ` [dpdk-dev] [PATCH v2 00/13] introduce fail-safe PMD Neil Horman
2017-03-09  9:15     ` Bruce Richardson
2017-03-10  9:13       ` Gaëtan Rivet
2017-03-10 22:43         ` Neil Horman
2017-03-14 14:49           ` Gaëtan Rivet
2017-03-15  3:28             ` Bruce Richardson
2017-03-15 11:15               ` Thomas Monjalon
2017-03-15 14:25                 ` Gaëtan Rivet
2017-03-16 20:50                   ` Neil Horman [this message]
2017-03-17 10:56                     ` Gaëtan Rivet
2017-03-18 19:51                       ` Neil Horman
2017-03-20 15:00   ` Thomas Monjalon
2017-05-17 12:50     ` Ferruh Yigit
2017-05-17 16:59       ` Gaëtan Rivet
2017-03-23 13:01   ` Ferruh Yigit

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=20170316205043.GA4472@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=techboard@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /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).