A new single function that is able to parse all currently supported
format:
* Domain-Bus-Device-Function
* Bus-Device-Function
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
return rte_pci_addr_cmp(addr, addr2);
}
+int
+rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr)
+{
+ if (rte_pci_bdf_parse(str, addr) == 0 ||
+ rte_pci_dbdf_parse(str, addr) == 0)
+ return 0;
+ return -1;
+}
+
void
pci_name_set(struct rte_pci_device *dev)
{
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
rte_lcore_has_role;
rte_memcpy_ptr;
rte_pci_addr_cmp;
+ rte_pci_addr_parse;
rte_pci_bdf_parse;
rte_pci_dbdf_parse;
rte_pci_device_name;