DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH v7 1/5] dev: hide driver export macros
Date: Wed, 11 Jun 2025 11:45:28 +0200	[thread overview]
Message-ID: <20250611094532.1242167-2-david.marchand@redhat.com> (raw)
In-Reply-To: <20250611094532.1242167-1-david.marchand@redhat.com>

The macros for tagging/exporting informations about a driver do not need
to be exported in the public API.
Move this to driver only header.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/include/dev_driver.h | 41 ++++++++++++++++++++++++++++++++++++
 lib/eal/include/rte_dev.h    | 41 ------------------------------------
 2 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/lib/eal/include/dev_driver.h b/lib/eal/include/dev_driver.h
index c07d83a43a..22e48226f9 100644
--- a/lib/eal/include/dev_driver.h
+++ b/lib/eal/include/dev_driver.h
@@ -30,4 +30,45 @@ struct rte_device {
 	struct rte_devargs *devargs;  /**< Arguments for latest probing */
 };
 
+#define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
+
+#define RTE_PMD_EXPORT_NAME(name, idx) \
+static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
+__rte_used = RTE_STR(name)
+
+#define DRV_EXP_TAG(name, tag) __##name##_##tag
+
+#define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
+static const char DRV_EXP_TAG(name, pci_tbl_export)[] __rte_used = \
+RTE_STR(table)
+
+#define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
+static const char DRV_EXP_TAG(name, param_string_export)[] \
+__rte_used = str
+
+/**
+ * Advertise the list of kernel modules required to run this driver
+ *
+ * This string lists the kernel modules required for the devices
+ * associated to a PMD. The format of each line of the string is:
+ * "<device-pattern> <kmod-expression>".
+ *
+ * The possible formats for the device pattern are:
+ *   "*"                     all devices supported by this driver
+ *   "pci:*"                 all PCI devices supported by this driver
+ *   "pci:v8086:d*:sv*:sd*"  all PCI devices supported by this driver
+ *                           whose vendor id is 0x8086.
+ *
+ * The format of the kernel modules list is a parenthesized expression
+ * containing logical-and (&) and logical-or (|).
+ *
+ * The device pattern and the kmod expression are separated by a space.
+ *
+ * Example:
+ * - "* igb_uio | uio_pci_generic | vfio"
+ */
+#define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
+static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
+__rte_used = str
+
 #endif /* DEV_DRIVER_H */
diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h
index 738400e8d1..7eca5e8cf2 100644
--- a/lib/eal/include/rte_dev.h
+++ b/lib/eal/include/rte_dev.h
@@ -232,47 +232,6 @@ int rte_dev_remove(struct rte_device *dev);
  */
 typedef int (*rte_dev_cmp_t)(const struct rte_device *dev, const void *data);
 
-#define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
-
-#define RTE_PMD_EXPORT_NAME(name, idx) \
-static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
-__rte_used = RTE_STR(name)
-
-#define DRV_EXP_TAG(name, tag) __##name##_##tag
-
-#define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
-static const char DRV_EXP_TAG(name, pci_tbl_export)[] __rte_used = \
-RTE_STR(table)
-
-#define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
-static const char DRV_EXP_TAG(name, param_string_export)[] \
-__rte_used = str
-
-/**
- * Advertise the list of kernel modules required to run this driver
- *
- * This string lists the kernel modules required for the devices
- * associated to a PMD. The format of each line of the string is:
- * "<device-pattern> <kmod-expression>".
- *
- * The possible formats for the device pattern are:
- *   "*"                     all devices supported by this driver
- *   "pci:*"                 all PCI devices supported by this driver
- *   "pci:v8086:d*:sv*:sd*"  all PCI devices supported by this driver
- *                           whose vendor id is 0x8086.
- *
- * The format of the kernel modules list is a parenthesized expression
- * containing logical-and (&) and logical-or (|).
- *
- * The device pattern and the kmod expression are separated by a space.
- *
- * Example:
- * - "* igb_uio | uio_pci_generic | vfio"
- */
-#define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
-static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
-__rte_used = str
-
 /**
  * Iteration context.
  *
-- 
2.49.0


  reply	other threads:[~2025-06-11  9:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 10:09 [PATCH v6 0/4] allow pmdinfo to be inserted and parsed using MSVC David Marchand
2025-06-10 10:09 ` [PATCH v6 1/4] dev: hide driver export macros David Marchand
2025-06-10 10:09 ` [PATCH v6 2/4] dev: export driver information with MSVC David Marchand
2025-06-10 12:13   ` David Marchand
2025-06-10 10:09 ` [PATCH v6 3/4] buildtools: embed " David Marchand
2025-06-10 10:09 ` [PATCH v6 4/4] usertools: enable pmdinfo " David Marchand
2025-06-10 10:17   ` Robin Jarry
2025-06-11  9:45 ` [PATCH v7 0/5] allow pmdinfo to be inserted and parsed using MSVC David Marchand
2025-06-11  9:45   ` David Marchand [this message]
2025-06-11 13:24     ` [PATCH v7 1/5] dev: hide driver export macros Andre Muezerie
2025-06-11  9:45   ` [PATCH v7 2/5] dev: rename pmdinfo internal symbols David Marchand
2025-06-11 13:26     ` Andre Muezerie
2025-06-11  9:45   ` [PATCH v7 3/5] dev: export driver information with MSVC David Marchand
2025-06-11 13:27     ` Andre Muezerie
2025-06-11  9:45   ` [PATCH v7 4/5] buildtools: embed " David Marchand
2025-06-11 13:28     ` Andre Muezerie
2025-06-11  9:45   ` [PATCH v7 5/5] usertools: enable pmdinfo " David Marchand
2025-06-12 13:23   ` [PATCH v7 0/5] allow pmdinfo to be inserted and parsed using MSVC David Marchand

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=20250611094532.1242167-2-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=roretzla@linux.microsoft.com \
    /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).