pci: introduce PCI address parsing function
[dpdk.git] / lib / librte_eal / common / include / rte_pci.h
index 9ac19d5..11ba442 100644 (file)
@@ -346,6 +346,20 @@ int rte_pci_addr_cmp(const struct rte_pci_addr *addr,
 int rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
                             const struct rte_pci_addr *addr2);
 
+/**
+ * Utility function to parse a string into a PCI location.
+ *
+ * @param str
+ *     The string to parse
+ * @param addr
+ *     The reference to the structure where the location
+ *     is stored.
+ * @return
+ *     0 on success
+ *     <0 otherwise
+ */
+int rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr);
+
 /**
  * Scan the content of the PCI bus, and the devices in the devices
  * list