From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v15 4/7] bus/pci: implement sigbus handler ops Date: Mon, 15 Oct 2018 15:41:26 +0200 Message-ID: <4075531.4ZLKP4gcBB@xps> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1539602847-19220-1-git-send-email-jia.guo@intel.com> <1539602847-19220-5-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit 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, arybchenko@solarflare.com, wenzhuo.lu@intel.com, anatoly.burakov@intel.com, jerin.jacob@caviumnetworks.com, jblunck@infradead.org, shreyansh.jain@nxp.com, helin.zhang@intel.com To: Jeff Guo Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C76A3160 for ; Mon, 15 Oct 2018 15:41:32 +0200 (CEST) In-Reply-To: <1539602847-19220-5-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 15/10/2018 13:27, Jeff Guo: > This patch implements the ops for the PCI bus sigbus handler. It finds the > PCI device that is being hot-unplugged and calls the relevant ops of the > hot-unplug handler to handle the hot-unplug failure of the device. > > Signed-off-by: Jeff Guo > Acked-by: Shaopeng He > Acked-by: Konstantin Ananyev > --- > v15->v14: > fix compling issue. > --- > +static struct rte_pci_device * > +pci_find_device_by_addr(const void *failure_addr) > +{ > + struct rte_pci_device *pdev = NULL; > + uint64_t check_point, start, end, len; > + int i; > + > + check_point = (uint64_t)(uintptr_t)failure_addr; > + > + FOREACH_DEVICE_ON_PCIBUS(pdev) { > + for (i = 0; i != RTE_DIM(pdev->mem_resource); i++) { > + start = (uint64_t)(uintptr_t)pdev->mem_resource[i].addr; > + len = pdev->mem_resource[i].len; > + end = (uint64_t)(uintptr_t)RTE_PTR_ADD(start, len); When compiling for 32-bit, there is an error: cast to pointer from integer of different size start is not a pointer. I think it must be replaced by a simple addition. end = start + len;