From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EDAC4A04B6; Tue, 13 Oct 2020 00:03:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A0D121D9E3; Tue, 13 Oct 2020 00:03:12 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 55ECC1D9DC for ; Tue, 13 Oct 2020 00:03:10 +0200 (CEST) IronPort-SDR: Nhg176CoeZuKL1ys/IuxN0RTj5ZYYiLf8Xga1KfyHVhZeC62EE4G9yIrVUZJqCnCFJpvWPbzgS BHXd/3AXjR1w== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="152741116" X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="152741116" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 15:03:08 -0700 IronPort-SDR: d8Z+L7V4E4t/InjX21F9s/c/XStl95hQ1tRdHLQ8C/EiZDUbAwK9dQReYjE5whJVcBIccQtUH1 Rbqxzvdx6RtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="345985922" Received: from jrharri1-skx.ch.intel.com ([143.182.137.73]) by orsmga008.jf.intel.com with ESMTP; 12 Oct 2020 15:03:07 -0700 From: Jim Harris To: dev@dpdk.org, thomas@monjalon.net Cc: Jim Harris Date: Mon, 12 Oct 2020 15:01:36 -0700 Message-Id: <20201012220136.6618-1-james.r.harris@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200824211038.48932-1-james.r.harris@intel.com> References: <20200824211038.48932-1-james.r.harris@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] pci/linux: copy new id for inserted device 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When a device is inserted into an existing BDF slot that has not been probed, we must overwrite the old PCI ID with the ID of the new function. Otherwise we may not probe the function with the correct driver, if at all. Signed-off-by: Jim Harris --- drivers/bus/pci/linux/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index a2198abf4..2e37735c2 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -352,6 +352,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) if (!rte_dev_is_probed(&dev2->device)) { dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; + dev2->id = dev->id; pci_name_set(dev2); memmove(dev2->mem_resource, dev->mem_resource, @@ -365,7 +366,8 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) * need to do anything here unless... **/ if (dev2->kdrv != dev->kdrv || - dev2->max_vfs != dev->max_vfs) + dev2->max_vfs != dev->max_vfs || + dev2->id != dev->id) /* * This should not happens. * But it is still possible if -- 2.20.1