From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 05/11] bus: introduce hotplug functionality Date: Wed, 28 Jun 2017 13:44:41 +0200 Message-ID: <4639959.eMbdazoqpE@xps> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Gaetan Rivet To: Jan Blunck Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id F303A2BE1 for ; Wed, 28 Jun 2017 13:44:42 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 27/06/2017 21:03, Jan Blunck: > On Tue, Jun 27, 2017 at 6:11 PM, Gaetan Rivet wrote: > > --- a/lib/librte_eal/common/include/rte_bus.h > > +++ b/lib/librte_eal/common/include/rte_bus.h > > /** > > + * Implementation specific probe function which is responsible for linking > > + * devices on that bus with applicable drivers. > > + * The plugged device might already have been used previously by the bus, > > + * in which case some buses might prefer to detect and re-use the relevant > > + * information pertaining to this device. > > + * > > + * @param da > > + * Device declaration. > > + * > > + * @return > > + * The pointer to a valid rte_device usable by the bus on success. > > + * NULL on error. rte_errno is then set. > > + */ > > +typedef struct rte_device * (*rte_bus_plug_t)(struct rte_devargs *da); > > Shouldn't this be orthogonal to unplug() and take a rte_device. You > should only be able to plug devices that have been found by scan > before. Plugging a device that has been scanned before is a special case. In a true hotplug scenario, we could use this plug function passing a devargs. I don't see any issue passing rte_devargs to plug and rte_device to unplug.