DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jim Harris <james.r.harris@intel.com>
To: dev@dpdk.org, thomas@monjalon.net
Cc: Jim Harris <james.r.harris@intel.com>
Subject: [dpdk-dev] [PATCH v3] pci/linux: copy new id for inserted device
Date: Mon, 12 Oct 2020 15:01:36 -0700	[thread overview]
Message-ID: <20201012220136.6618-1-james.r.harris@intel.com> (raw)
In-Reply-To: <20200824211038.48932-1-james.r.harris@intel.com>

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 <james.r.harris@intel.com>
---
 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


  parent reply	other threads:[~2020-10-12 22:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 22:06 [dpdk-dev] [PATCH] " Jim Harris
2020-08-24 21:10 ` [dpdk-dev] [PATCH v2] " Jim Harris
2020-10-07 15:05   ` Thomas Monjalon
2020-10-12 20:58     ` Harris, James R
2020-10-12 21:54       ` Thomas Monjalon
2020-10-12 22:01   ` Jim Harris [this message]
2020-10-13  8:40     ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2020-10-13 14:06     ` [dpdk-dev] [PATCH v4] " Jim Harris
2020-10-13 17:03     ` [dpdk-dev] [PATCH v5] " Jim Harris
2020-10-13 21:02       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201012220136.6618-1-james.r.harris@intel.com \
    --to=james.r.harris@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).