From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 62E811B04D for ; Wed, 4 Jul 2018 09:55:19 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EB9BF21F40; Wed, 4 Jul 2018 03:55:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 04 Jul 2018 03:55:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=52HpeeWeo0OlPcHJmIvuOfu/Wn f/0Ml34G0BYOS6Gl8=; b=dfhkzKjs/PW3BSnI6atZscdAyTc3fOt46iJg6lmODJ Wfb69bXfFNuHwlVG9FZ83X7klYe8VXd+NTVs5O+eB3Hvvry0XUV1idfOdZmV/0XI 1eIc4hZOKTJOPh3RMf39kGgAKgBiiOsrXTEQkNG71giQbFn7Dp36QbXVP5DuyQzm k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=52Hpee Weo0OlPcHJmIvuOfu/Wnf/0Ml34G0BYOS6Gl8=; b=a650M9/LVHmFMyJwcahV8N TpXYDsvtqpkHOiesxPKgWdZdUh+OHrix6hgfOsB2eSwBLUVVkgHln10jP8hndE3D ihWQjcbY4xpMVyjBm9cFUaVplKXhXMZx7TBmhwGHLsIoRHzMyi516wcYc9Zv4Bnk +Fqn8uN6OTwn63UM1Zkaf689Fjv5buG1K/mT2xMWNs3dZPWNoSdwtuwJlfYO82gy 3m5n4FSvtBmsZwqJNaIGHAqSQuPy6aoxzWUccoeR7vm6XOFWB7E/SKuJY6XVvD1O gkGFl6UDrNhktumLPirCRwYBE696FNgtaw2wHivnpwQ6YyPjsR1zr325XRL1KXrg == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4070C102E4; Wed, 4 Jul 2018 03:55:16 -0400 (EDT) From: Thomas Monjalon To: "Guo, Jia" Cc: dev@dpdk.org, stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.com, jingjing.wu@intel.com, motih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com, qi.z.zhang@intel.com, shaopeng.he@intel.com, bernard.iremonger@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, helin.zhang@intel.com Date: Wed, 04 Jul 2018 09:55:15 +0200 Message-ID: <2407710.IcmoihaDi7@xps> In-Reply-To: References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <6033435.uqaPCSQc1q@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH V4 1/9] bus: introduce hotplug failure handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 07:55:19 -0000 04/07/2018 09:16, Guo, Jia: > > On 7/4/2018 6:21 AM, Thomas Monjalon wrote: > > 29/06/2018 12:30, Jeff Guo: > >> /** > >> + * Implementation a specific hot plug handler, which is responsible > >> + * for handle the failure when hot remove the device, guaranty the system > >> + * would not crash in the case. > >> + * @param dev > >> + * Pointer of the device structure. > >> + * > >> + * @return > >> + * 0 on success. > >> + * !0 on error. > >> + */ > >> +typedef int (*rte_bus_hotplug_handler_t)(struct rte_device *dev); > > [...] > >> @@ -211,6 +224,8 @@ struct rte_bus { > >> rte_bus_parse_t parse; /**< Parse a device name */ > >> struct rte_bus_conf conf; /**< Bus configuration */ > >> rte_bus_get_iommu_class_t get_iommu_class; /**< Get iommu class */ > >> + rte_bus_hotplug_handler_t hotplug_handler; > >> + /**< handle hot plug on bus */ > > The name is misleading. > > It is to handle unplugging but is called "hotplug". > > ok, so i prefer hotplug_failure_handler than hot_unplug_handler, since > it is more explicit for failure handle, and more clearly. > > > In order to demonstrate how the handler is used, you should > > introduce the code using this handler in the same patch. > > > > sorry, i check the history of rte_bus.h, and the way is introduce ops at > first, second implement in specific bus, then come across the usage. > I think that way clear and make sense. what do you think? > Anyway, i will check the commit log if is there any misleading. I think it is better to call ops when they are introduced, and implement the ops in second step.