DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/pci: 'RTE_PMD_REGISTER_PCI' support expand 'nm'
@ 2022-08-02  8:48 Lichao Liu
  2023-07-16 18:17 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Lichao Liu @ 2022-08-02  8:48 UTC (permalink / raw)
  To: dev; +Cc: Lichao Liu

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@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-16 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-02  8:48 [PATCH] bus/pci: 'RTE_PMD_REGISTER_PCI' support expand 'nm' Lichao Liu
2023-07-16 18:17 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).