From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AD66A1B7CD for ; Wed, 4 Apr 2018 06:31:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 21:31:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,404,1517904000"; d="scan'208";a="217459258" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 03 Apr 2018 21:31:05 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Apr 2018 21:31:05 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Apr 2018 21:31:05 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.241]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.43]) with mapi id 14.03.0319.002; Wed, 4 Apr 2018 12:31:03 +0800 From: "Tan, Jianfeng" To: "Guo, Jia" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" , "Van Haaren, Harry" CC: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" Thread-Topic: [PATCH V18 1/5] bus: introduce device hot unplug handle Thread-Index: AQHTy3gwPaoVmZDt9kmMbK99adtCAaPwA8gA Date: Wed, 4 Apr 2018 04:31:02 +0000 Message-ID: References: <1522779443-1932-1-git-send-email-jia.guo@intel.com> <1522779443-1932-2-git-send-email-jia.guo@intel.com> In-Reply-To: <1522779443-1932-2-git-send-email-jia.guo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH V18 1/5] bus: introduce device hot unplug handle 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 Apr 2018 04:31:07 -0000 > -----Original Message----- > From: Guo, Jia > Sent: Wednesday, April 4, 2018 2:17 AM > To: stephen@networkplumber.org; Richardson, Bruce; Yigit, Ferruh; > Ananyev, Konstantin; gaetan.rivet@6wind.com; Wu, Jingjing; > thomas@monjalon.net; motih@mellanox.com; Van Haaren, Harry; Tan, > Jianfeng > Cc: jblunck@infradead.org; shreyansh.jain@nxp.com; dev@dpdk.org; Guo, > Jia; Zhang, Helin > Subject: [PATCH V18 1/5] bus: introduce device hot unplug handle >=20 > As of device hot unplug, we need some preparatory measures so that we wil= l > not encounter memory fault after device have been plug out of the system, > and also let we could recover the running data path but not been break. > This allows the buses to handle device hot unplug event. > In the following patch, will show how to handle the case for pci bus. Squeeze this patch with the next one. >=20 > Signed-off-by: Jeff Guo > --- > v16->v15: > split patch, and remove the ops from RTE_VERIFY > --- > lib/librte_eal/common/include/rte_bus.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/lib/librte_eal/common/include/rte_bus.h > b/lib/librte_eal/common/include/rte_bus.h > index 6fb0834..ecd8b1c 100644 > --- a/lib/librte_eal/common/include/rte_bus.h > +++ b/lib/librte_eal/common/include/rte_bus.h > @@ -168,6 +168,19 @@ typedef int (*rte_bus_unplug_t)(struct rte_device > *dev); > typedef int (*rte_bus_parse_t)(const char *name, void *addr); >=20 > /** > + * Implementation specific hot unplug handler function which is responsi= ble > + * for handle the failure when hot unplug the device, guaranty the syste= m > + * would not crash in the case. > + * @param dev > + * Pointer of the device structure. > + * > + * @return > + * 0 on success. > + * !0 on error. > + */ > +typedef int (*rte_bus_handle_hot_unplug_t)(struct rte_device *dev); > + > +/** > * Bus scan policies > */ > enum rte_bus_scan_mode { > @@ -209,6 +222,8 @@ struct rte_bus { > rte_bus_plug_t plug; /**< Probe single device for drivers */ > rte_bus_unplug_t unplug; /**< Remove single device from driver > */ > rte_bus_parse_t parse; /**< Parse a device name */ > + rte_bus_handle_hot_unplug_t handle_hot_unplug; /**< handle when device > + hot unplug */ May be just rte_bus_hot_unplug_t hot_unplug /**< Handle hot unplug device e= vent */ > struct rte_bus_conf conf; /**< Bus configuration */ > rte_bus_get_iommu_class_t get_iommu_class; /**< Get iommu > class */ > }; > -- > 2.7.4