DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pci/linux: copy new id for inserted device
@ 2020-08-21 22:06 Jim Harris
  2020-08-24 21:10 ` [dpdk-dev] [PATCH v2] " Jim Harris
  0 siblings, 1 reply; 10+ messages in thread
From: Jim Harris @ 2020-08-21 22:06 UTC (permalink / raw)
  To: dev; +Cc: Jim Harris

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..4701661e5 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;
+					memcpy(&dev2->id, &dev->id, sizeof(dev2->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 ||
+						memcmp(&dev2->id, &dev->id, sizeof(dev2->id))
 						/*
 						 * This should not happens.
 						 * But it is still possible if
-- 
2.20.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-10-13 21:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 22:06 [dpdk-dev] [PATCH] pci/linux: copy new id for inserted device 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   ` [dpdk-dev] [PATCH v3] " Jim Harris
2020-10-13  8:40     ` 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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git