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 D0E131559; Sun, 30 Sep 2018 10:52:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DF86C21908; Sun, 30 Sep 2018 04:52:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 30 Sep 2018 04:52:48 -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=yOCIILDVPa9+QdATsQrdpDJ5OG pjNjvKavXG9k2wsqM=; b=JybCwmgLUcZ3iO9cusZDnDSmsVsK56niVF3xPzwxUH UC+gN5chbdGV4aNHWQUF9KNtZpQYLHM0sWJb37nvyOFgwR56GBigsHgywwNYrMKp E5yYkoUNWtpYfZDMN3HCQMC1LFBpRryx8fcNkNtlkNu1Kqvzvjl8H4qfIUmMcQRP 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=yOCIIL DVPa9+QdATsQrdpDJ5OGpjNjvKavXG9k2wsqM=; b=KwVZXJBjA1T0UMARmLx7/6 bwh4OZ9IU2XEMUwrrVscT2wi0wYJLKUkYNriJGc/+l+2qEGgglaFn7sJlJclO4tm xXpsgYqyFUcPZw34xva0L8OZia5F5J1fOUwaWP7NWD8GM86BnVu/o3xo7S48T8TH LIJ8/lqhzP6l2Y6sb3X0k+4Ra1VN/Xn++Af0jQcdyKVyegLSC0+1DozSpjji52yq P1kqHvmDJqyHyyzJRdeTcP9r8sXRgfJ2JKPnQnPJYKbrjqnfjKRzx5pOS6NtbYTI BJ5h11gDZ9KabvAl0gw0YjaUI7nu79IX7bM4G3saKyeyhwshekEvv1b4ijs+A3vA == 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 3C9E2102D2; Sun, 30 Sep 2018 04:52:47 -0400 (EDT) From: Thomas Monjalon To: "Zhang, Qi Z" Cc: "dev@dpdk.org" , "Burakov, Anatoly" , "Yigit, Ferruh" , "geoffrey.lv@gmail.com" , "ajit.khaparde@broadcom.com" , "stable@dpdk.org" Date: Sun, 30 Sep 2018 10:52:45 +0200 Message-ID: <384590219.OtUJQTVY6u@xps> In-Reply-To: <039ED4275CED7440929022BC67E70611532A7E71@SHSMSX103.ccr.corp.intel.com> References: <20180903084005.29706-1-qi.z.zhang@intel.com> <14389377.uLlNGEYteW@xps> <039ED4275CED7440929022BC67E70611532A7E71@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] bus/pci: fix unexpected resource mapping override X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Sep 2018 08:52:51 -0000 29/09/2018 08:43, Zhang, Qi Z: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > Hi, > > > > 03/09/2018 10:40, Qi Zhang: > > > When scanning an already plugged device, the virtual address of mapped > > > PCI resource in rte_pci_device will be overridden with 0, that may > > > cause driver does not work correctly. > > > > Why is it overridden with 0? > > Can we try to fix the root cause? > > From my view this is place to fix the issue: "scan an already probed device will corrupt the PCI resource map" > Another option is "to prevent scan an already probed device", this can be implemented by adding some check before bus->scan in rte_dev_hotplug_add but I'm not prefer for this solution, because it's better to keep bus->scan's independency. I don't understand why we are currently changing an already scanned device in pci_scan_one. We could check the PCI address is known at the beginning and stop here, even before allocating a new rte_pci_device. Why trying to override with this memmove?