From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C97881BED8 for ; Wed, 4 Jul 2018 09:16:23 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2018 00:16:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,306,1526367600"; d="scan'208";a="242850411" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.88]) ([10.67.68.88]) by fmsmga006.fm.intel.com with ESMTP; 04 Jul 2018 00:16:16 -0700 To: Thomas Monjalon 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> <6033435.uqaPCSQc1q@xps> 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 From: "Guo, Jia" Message-ID: Date: Wed, 4 Jul 2018 15:16:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <6033435.uqaPCSQc1q@xps> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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:16:24 -0000 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.