DPDK patches and discussions
 help / color / mirror / Atom feed
From: Lichao Liu <liulichao.09679@bytedance.com>
To: dev@dpdk.org
Cc: Lichao Liu <liulichao.09679@bytedance.com>
Subject: [PATCH] bus/pci: 'RTE_PMD_REGISTER_PCI' support expand 'nm'
Date: Tue,  2 Aug 2022 16:48:39 +0800	[thread overview]
Message-ID: <20220802084839.30118-1-liulichao.09679@bytedance.com> (raw)

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


             reply	other threads:[~2022-08-11  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  8:48 Lichao Liu [this message]
2023-07-16 18:17 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802084839.30118-1-liulichao.09679@bytedance.com \
    --to=liulichao.09679@bytedance.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).