From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4724A21F38; Mon, 15 Oct 2018 09:41:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 15 Oct 2018 09:41:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=SqgN7l/e4ZWNs92e4/ywfZDIVvYavCCRGmTgD5wqfV8=; b=DQg+OmFMX1IM IYtJOIltfGCkKwoJw72S0lhh5FsZdg8t3CJeSC1h8AEsg3xbzUXEtFFQF91GYz6s Vq3KZfgBrgQeWl64OXn2OaThbg5mwNwItic0XWvdM8yIqkQrXJHQzLsrwCwRyrvi MUCwgJhqouFA62+jcA8uMc0dkU8fWb8= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=SqgN7l/e4ZWNs92e4/ywfZDIVvYavCCRGmTgD5wqf V8=; b=bvilL1Ms1la9L2A0IpWs78o4yJ0qzUpAvg2gaMRohuWRNM2t2ukIp9DhX ySbPeR6p/OkWZBYDr3rqADTSJ0jJCO0PdwUQVC7rbQ7EZ5MWjLDKkG99w9ksYSAo tm+aBJpcPoPOpjB/BYQaUV6FJ3BpRQ8VZHPMilHTuRFSQFiEH+yMup0JWfyjKMGB valJsl0hUlDnCR6jU2t0M+TzG+3aQL5eWuqtG6ckVXXWhx9ZthxFCHUpR+N9ORHn vvyC1pq39UE1MG/Z8VIO9Wzy5LFEMMUVDYkfKV/FsE44l25CF/wu1/Rz4JnWwsCj QxgZHARUK+vxPgb6hlpmXr9LPt8Qg== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 36C18E40E6; Mon, 15 Oct 2018 09:41:26 -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, 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 Date: Mon, 15 Oct 2018 15:41:26 +0200 Message-ID: <4075531.4ZLKP4gcBB@xps> In-Reply-To: <1539602847-19220-5-git-send-email-jia.guo@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v15 4/7] bus/pci: implement sigbus handler ops 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: Mon, 15 Oct 2018 13:41:33 -0000 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;