[dpdk-dev] [PATCH] ethdev: support PCI domains
Sinan Kaya
okaya at codeaurora.org
Fri Jul 22 17:34:10 CEST 2016
The current code is enumerating devices based on bus, device and function
pairs. This does not work well for architectures with multiple PCI
segments/domains. Multiple PCI devices will have the same BDF value but
different segment numbers (01:01:01.0 and 02:01:01.0) for instance.
Adding segment numbers to device naming so that we can uniquely identify
devices.
Signed-off-by: Sinan Kaya <okaya at codeaurora.org>
---
lib/librte_ether/rte_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0a6e3f1..929240f 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -226,7 +226,8 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size,
{
int ret;
- ret = snprintf(name, size, "%d:%d.%d",
+ ret = snprintf(name, size, "%d:%d:%d.%d",
+ pci_dev->addr.domain,
pci_dev->addr.bus, pci_dev->addr.devid,
pci_dev->addr.function);
if (ret < 0)
--
1.8.2.1
More information about the dev
mailing list