From 1a2d1f62d7ba2b36d031ecf60ad4eb11117c670a Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Thu, 26 Oct 2017 12:06:00 +0200 Subject: [PATCH] pci: make specialized parsing functions private Do not expose the minute implementations of PCI parsing. This leaves only the all-purpose rte_pci_addr_parse, which is simpler to use. Signed-off-by: Gaetan Rivet --- doc/guides/rel_notes/deprecation.rst | 6 ++--- lib/librte_eal/common/eal_common_pci.c | 4 ++-- lib/librte_eal/common/include/rte_pci.h | 29 ------------------------- lib/librte_eal/rte_eal_version.map | 2 -- 4 files changed, 4 insertions(+), 37 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 4293014790..a93c3e1706 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -31,12 +31,10 @@ Deprecation Notices * pci: Several exposed functions are misnamed. The following functions are deprecated starting from v17.11 and are replaced: - - ``eal_parse_pci_BDF`` replaced by ``rte_pci_bdf_parse`` - - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_dbdf_parse`` + - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse`` + - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse`` - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp`` - The functions are only renamed. Their behavior is not affected. - * ethdev: Tx offloads will no longer be enabled by default in 17.11. Instead, the ``rte_eth_txmode`` structure will be extended with bit field to enable each Tx offload. diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index d01b0f9d5b..70729d20ff 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -105,7 +105,7 @@ get_u8_pciaddr_field(const char *in, void *_u8, char dlm) } -int +static int rte_pci_bdf_parse(const char *input, struct rte_pci_addr *dev_addr) { const char *in = input; @@ -129,7 +129,7 @@ eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr) return rte_pci_bdf_parse(input, dev_addr); } -int +static int rte_pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr) { const char *in = input; diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 11ba442be2..11ade4d71e 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -240,21 +240,6 @@ struct mapped_pci_resource { /** mapped pci device list */ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); -/** - * Utility function to produce a PCI Bus-Device-Function value - * given a string representation. Assumes that the BDF is provided without - * a domain prefix (i.e. domain returned is always 0) - * - * @param input - * The input string to be parsed. Should have the format XX:XX.X - * @param dev_addr - * The PCI Bus-Device-Function address to be returned. Domain will always be - * returned as 0 - * @return - * 0 on success, negative on error. - */ -int rte_pci_bdf_parse(const char *input, struct rte_pci_addr *dev_addr); - /** * @deprecated * Utility function to produce a PCI Bus-Device-Function value @@ -271,20 +256,6 @@ int rte_pci_bdf_parse(const char *input, struct rte_pci_addr *dev_addr); */ int eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr); -/** - * Utility function to produce a PCI Bus-Device-Function value - * given a string representation. Assumes that the BDF is provided including - * a domain prefix. - * - * @param input - * The input string to be parsed. Should have the format XXXX:XX:XX.X - * @param dev_addr - * The PCI Bus-Device-Function address to be returned - * @return - * 0 on success, negative on error. - */ -int rte_pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr); - /** * @deprecated * Utility function to produce a PCI Bus-Device-Function value diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 3568694367..180eee8937 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -255,8 +255,6 @@ DPDK_17.11 { rte_memcpy_ptr; rte_pci_addr_cmp; rte_pci_addr_parse; - rte_pci_bdf_parse; - rte_pci_dbdf_parse; rte_pci_device_name; rte_pci_get_iommu_class; rte_pci_match; -- 2.20.1