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 954C21B3AA for ; Wed, 4 Jul 2018 00:21:09 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1169E21DC1; Tue, 3 Jul 2018 18:21:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 03 Jul 2018 18:21:09 -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=qSK0BxqFoydOAn61VMWqgcAGPN YPmy0g1NuC4wurgP8=; b=TrOn8t7RjrFITsUVHJSYieypN2ZHQqosyALMB4Bp+3 jk1viPyMAiR+7rBY7Li8Wjw0kIKuVTcaOvC4+Uls2jh+g9hx88JoX4lbolaF+JUn 77cxpQsMjK32FF3CP64OdqOrtxjVo+og5iItCNGPuR2lXfRzeNfTjRTdjeUnmyS5 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=qSK0Bx qFoydOAn61VMWqgcAGPNYPmy0g1NuC4wurgP8=; b=V1cD8J4L2GDw89EBu5UE+B vEzgdJNXlZRm64wjj6wVEJRPsDHKM+YYvt2Jl/dy/RYGoD+s5XeX7oupILmY8yse wRN9eVs2BIcblkYibD2sVKCQfgREpjdrMD7mjbmG4116/Z7W4M9TCoxRFj1dI03I 55dsYvX1vRmbuAu6jpzIROZPniUbWjwyvM8CJxdEPMjx62ovQ8E8+5BrgGNDbhP7 bpnoO39dsoZ75uKCCCf009araq1PTVOtaAH60x/vN2Hm244HENusD1dDgoSpIpyI J4WrNWiQwRxoArnd4ib96UG9TRDyTQlanY+cEPLOT0LH0wm0u9xF5JYcq6KBr26w == 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 2186810255; Tue, 3 Jul 2018 18:21:06 -0400 (EDT) From: Thomas Monjalon To: Jeff Guo 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 00:21:04 +0200 Message-ID: <6033435.uqaPCSQc1q@xps> In-Reply-To: <1530268248-7328-2-git-send-email-jia.guo@intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1530268248-7328-1-git-send-email-jia.guo@intel.com> <1530268248-7328-2-git-send-email-jia.guo@intel.com> 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: Tue, 03 Jul 2018 22:21:09 -0000 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". In order to demonstrate how the handler is used, you should introduce the code using this handler in the same patch.