From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gaetan.rivet@6wind.com>
Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com
 [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id C68E11BB9D
 for <dev@dpdk.org>; Tue, 26 Jun 2018 18:34:06 +0200 (CEST)
Received: by mail-wr0-f193.google.com with SMTP id k16-v6so17923790wro.0
 for <dev@dpdk.org>; Tue, 26 Jun 2018 09:34:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:content-transfer-encoding:in-reply-to
 :user-agent; bh=YzQbDpAEKwxtBShkp7S1pnIm/kfXTh+5gPhp/gIj02Y=;
 b=DBe+QhB+DDzVf3S7zCwX+UOewasGemzHfNMQmcjuw+2OWTecN1iSsI00CSdpJn32/y
 w6v9ryQypXjzWFstj/1okllPqOz3y4m5/R25cCZ5Rr6yLVv5IsQ5rVasPxT5N4wKKk3c
 V7uXibq0muY5LyY2nJgXNyY8LNkgArfN+0daHB6IimsbHJIE5lCBGalWCFf6PQaorZhm
 jgDaDouCCks0OU72gsYXYK1U54P6TSY7S82h7y8fxPvNOreI3+/szSunrdpniLtRAEah
 XYpX38goBfYU5TaEuf0CxRg2qqpUUDO5HP4rLc2pjKJvKqnbjMCenhvEA2K9Vwfve5Pk
 yZhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:content-transfer-encoding
 :in-reply-to:user-agent;
 bh=YzQbDpAEKwxtBShkp7S1pnIm/kfXTh+5gPhp/gIj02Y=;
 b=Ap+aq8EORJfTGnviOccIdRxjBjKH0MRJvtlyFHTcDRrnehmHVp6peqzeCEcezD0yU9
 PYOHqSe+bSEgNofqEeS4Gvl3ER5FvkFJA8gh7tB9vh5lPkX9MCMEVxEi/Qwggfb6SBjL
 o1qC1FtNUSA59YAxZ6DARf7MBSvU05dS23l2N34kSk2fGAGQUflrlxQ6MDIUP3c17ENt
 ECVTgu3ni22zA83YTevnYJRAbAV3I1opV+FujANE3NyO+5xBOzWALisO4p3Z9ebd9rps
 9qi7Zd0/s+cCKQjEWiZuW99dg6zU1lWpkuUIlVvcdkktIJ+W/O05/QUkIiyz7Hyta/7M
 x4Ag==
X-Gm-Message-State: APt69E0E2OqysnjyF3Y6XGRTMcUV5XQT8cGFgCk2xSNkPegDHge2beiX
 qQMNQ+TT80mT+XQcUNWO5bzEcg==
X-Google-Smtp-Source: AAOMgpdickCKUXSIvDMXAlT635Li4YHf7lSXHFggi9vfly+KTp+yG85mkJZtDxMxqM/mimEBtnTNlA==
X-Received: by 2002:adf:dd07:: with SMTP id a7-v6mr2216688wrm.2.1530030846207; 
 Tue, 26 Jun 2018 09:34:06 -0700 (PDT)
Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com.
 [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id s10-v6sm3541839wmb.12.2018.06.26.09.34.04
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 26 Jun 2018 09:34:05 -0700 (PDT)
Date: Tue, 26 Jun 2018 18:33:48 +0200
From: =?iso-8859-1?Q?Ga=EBtan?= Rivet <gaetan.rivet@6wind.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>,
 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>,
 "Richardson, Bruce" <bruce.richardson@intel.com>,
 "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 "Shelton, Benjamin H" <benjamin.h.shelton@intel.com>,
 "Vangati, Narender" <narender.vangati@intel.com>
Message-ID: <20180626163348.ds35fttkd5easc6k@bidouze.vm.6wind.com>
References: <20180607123849.14439-1-qi.z.zhang@intel.com>
 <20180626070832.3055-1-qi.z.zhang@intel.com>
 <20180626070832.3055-2-qi.z.zhang@intel.com>
 <c1bb445c-e5c8-d82e-81d6-a0304a8ac07a@intel.com>
 <039ED4275CED7440929022BC67E706115323E74C@SHSMSX103.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <039ED4275CED7440929022BC67E706115323E74C@SHSMSX103.ccr.corp.intel.com>
User-Agent: NeoMutt/20170113 (1.7.2)
Subject: Re: [dpdk-dev] [PATCH v4 01/24] eal: introduce one device scan
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2018 16:34:06 -0000

On Tue, Jun 26, 2018 at 12:26:05PM +0000, Zhang, Qi Z wrote:
> 
> 
> > -----Original Message-----
> > From: Burakov, Anatoly
> > Sent: Tuesday, June 26, 2018 7:48 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; thomas@monjalon.net
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org;
> > Richardson, Bruce <bruce.richardson@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Shelton, Benjamin H
> > <benjamin.h.shelton@intel.com>; Vangati, Narender
> > <narender.vangati@intel.com>
> > Subject: Re: [PATCH v4 01/24] eal: introduce one device scan
> > 
> > On 26-Jun-18 8:08 AM, Qi Zhang wrote:
> > > When hot plug a new device, it is not necessary to scan everything on
> > > the bus since the devname and devargs are already there. So new
> > > rte_bus ops "scan_one" is introduced, bus driver can implement this
> > > function to simplify the hotplug process.
> > >
> > > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > > ---
> > >
> > 
> > <snip>
> > 
> > > + *	NULL for unsuccessful scan
> > > + */
> > > +typedef struct rte_device *(*rte_bus_scan_one_t)(struct rte_devargs
> > > +*devargs);
> > > +
> > > +/**
> > >    * Implementation specific probe function which is responsible for linking
> > >    * devices on that bus with applicable drivers.
> > >    *
> > > @@ -204,6 +219,7 @@ struct rte_bus {
> > >   	TAILQ_ENTRY(rte_bus) next;   /**< Next bus object in linked list */
> > >   	const char *name;            /**< Name of the bus */
> > >   	rte_bus_scan_t scan;         /**< Scan for devices attached to
> > bus */
> > > +	rte_bus_scan_one_t scan_one; /**< Scan one device using devargs */
> > >   	rte_bus_probe_t probe;       /**< Probe devices on bus */
> > >   	rte_bus_find_device_t find_device; /**< Find a device on the bus */
> > >   	rte_bus_plug_t plug;         /**< Probe single device for drivers
> > */
> > >
> > 
> > Does changing this structure break ABI for bus drivers?
> 
> For bus driver, I think yes, but I'm not sure what I should do for this, since this is not for application
> 
> 

This should be appropriately announced in advance, in general.
However, it seems there is some leeway if the new field will not move
the others and not make the structure grow (i.e. replace a padding).

There is an ABI check script that can be used.

This however breaks the bus ABI, which breaks the EAL ABI.
This is usually an issue.

More generally, I was in favor of changing the whole bus scan process to a
per-device iteration. I was shut down on this when adding hotplug.
As a result, bus->scan() process was made to require the operation to be
idempotent.

Adding a new ops adds noise to the bus API. It should be kept as clean
as possible. This new one seems unnecessary, now that all bus scans are
idempotent (when supporting hotplug).

Regards,
-- 
Gaƫtan Rivet
6WIND