[PATCH] bus/pci: 'RTE_PMD_REGISTER_PCI' support expand 'nm'
Lichao Liu
liulichao.09679 at bytedance.com
Tue Aug 2 10:48:39 CEST 2022
Before, 'RTE_PMD_REGISTER_PCI' can not expand nm. So, it can not
work in this situation:
#define TEST(a, b) a##_##b
RTE_PMD_REGISTER_PCI(TEST(a, b), test_pmd_driver)
Signed-off-by: Lichao Liu <liulichao.09679 at bytedance.com>
---
drivers/bus/pci/rte_bus_pci.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index 1c6a8fdd7b..4f11bda19d 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -270,8 +270,7 @@ int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
*/
void rte_pci_register(struct rte_pci_driver *driver);
-/** Helper for PCI device registration from driver (eth, crypto) instance */
-#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \
+#define _RTE_PMD_REGISTER_PCI(nm, pci_drv) \
RTE_INIT(pciinitfn_ ##nm) \
{\
(pci_drv).driver.name = RTE_STR(nm);\
@@ -279,6 +278,10 @@ RTE_INIT(pciinitfn_ ##nm) \
} \
RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
+/** Helper for PCI device registration from driver (eth, crypto) instance */
+#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \
+ _RTE_PMD_REGISTER_PCI(nm, pci_drv)
+
/**
* Unregister a PCI driver.
*
--
2.20.1
More information about the dev
mailing list