From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4 05/12] net/failsafe: add plug-in support Date: Thu, 1 Jun 2017 11:00:10 -0700 Message-ID: <20170601110010.79a147c2@xeon-e3> References: <6b96432155ffd2d5fc6f6011a0b229c2224116f8.1496065002.git.gaetan.rivet@6wind.com> <20170531081526.3e8de246@xeon-e3> <20170601141241.GC18840@bidouze.vm.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: =?UTF-8?B?R2HDq3Rhbg==?= Rivet Return-path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 75D717CCE for ; Thu, 1 Jun 2017 20:00:19 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id e193so33760634pfh.0 for ; Thu, 01 Jun 2017 11:00:19 -0700 (PDT) In-Reply-To: <20170601141241.GC18840@bidouze.vm.6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 1 Jun 2017 16:12:41 +0200 Ga=C3=ABtan Rivet wrote: > On Wed, May 31, 2017 at 08:15:26AM -0700, Stephen Hemminger wrote: > > On Mon, 29 May 2017 15:42:17 +0200 > > Gaetan Rivet wrote: > > =20 > > > Periodically check for the existence of a device. > > > If a device has not been initialized and exists on the system, then it > > > is probed and configured. > > >=20 > > > The configuration process strives to synchronize the states between t= he > > > plugged-in sub-device and the fail-safe device. =20 > >=20 > > There are existing event models (udev and netlink) that could be used to > > do plug-in support without polling. Polling relies on application doing > > rte_alarms and many don't. =20 >=20 > Indeed. This possibility arose during development. >=20 > The main issue with it however is that it introduces an asynchronous > design, which the DPDK and PMDs underneath are not well-suited to > interact with. It goes against the grain in a way. >=20 > The polling is simple. It can work with all models of device and is > independent of event models specific to any architecture. >=20 > It also allows to simplify the contexts in which probing and > removal are done. Currently there is only one, the interrupt thread. > This solves a few possible race conditions without having to resort to > critical sections. >=20 > The only dependency is on another DPDK subsystem, rte_alarm. > I used alarms here because rte_timers need regular rte_timer_manage() > calls and there is little way to guarantee the frequency of the calls. >=20 > rte_alarms do not force any externalities on applications, thus allowing a > seamless use of the fail-safe. >=20 The issue with rte_alarm and also with LSC interrupt callbacks is that they don't run on a normal DPDK EAL application thread. These callbacks run on a DPDK internal pthread. I remember having to do some application hacks like having the callback generate an internal event on a pipe.