[v6,27/27] dev: hide device object
Checks
Commit Message
Make rte_device opaque for non internal users.
This will make extending this object possible without breaking the ABI.
Some applications may have been dereferencing rte_device objects, mark
this object's accessors as stable.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
Changes since RFC v2:
- updated release notes,
- marked accessors as stable,
---
doc/guides/rel_notes/deprecation.rst | 7 -----
doc/guides/rel_notes/release_22_11.rst | 4 +--
lib/eal/common/eal_private.h | 2 +-
lib/eal/include/dev_driver.h | 13 +++++++++
lib/eal/include/rte_dev.h | 37 --------------------------
lib/eal/version.map | 14 +++++-----
lib/vhost/vdpa.c | 1 +
7 files changed, 23 insertions(+), 55 deletions(-)
@@ -47,13 +47,6 @@ Deprecation Notices
* mempool: The mempool API macros ``MEMPOOL_PG_*`` are deprecated and
will be removed in DPDK 22.11.
-* drivers: As a follow-up of the work on the ``rte_bus`` object,
- the ``rte_driver`` and ``rte_device`` objects (and as a domino effect,
- their bus-specific counterparts) will be made opaque in DPDK 22.11.
- Registering a driver on a bus will be marked as an internal API:
- external users may still register their drivers using the bus-specific
- driver header (see ``enable_driver_sdk`` meson option).
-
* bus: The ``dev->device.numa_node`` field is set by each bus driver for
every device it manages to indicate on which NUMA node this device lies.
When this information is unknown, the assigned value is not consistent
@@ -98,8 +98,8 @@ API Changes
``vdev``, ``vmbus`` buses has been marked as an internal API.
External users may still register their driver using the associated driver
headers (see ``enable_driver_sdk`` meson option).
- The ``rte_driver`` object is now opaque and must be manipulated through added
- accessors.
+ The ``rte_driver`` and ``rte_device`` objects are now opaque and must be
+ manipulated through added accessors.
* raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <sys/queue.h>
-#include <rte_dev.h>
+#include <dev_driver.h>
#include <rte_lcore.h>
#include <rte_memory.h>
@@ -21,6 +21,19 @@ struct rte_driver {
const char *alias; /**< Driver alias. */
};
+/**
+ * A structure describing a generic device.
+ */
+struct rte_device {
+ RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */
+ const char *name; /**< Device name */
+ const char *bus_info; /**< Device bus specific information */
+ const struct rte_driver *driver; /**< Driver assigned after probing */
+ const struct rte_bus *bus; /**< Bus handle assigned on scan */
+ int numa_node; /**< NUMA node connection */
+ struct rte_devargs *devargs; /**< Arguments for latest probing */
+};
+
#ifdef __cplusplus
}
#endif
@@ -86,90 +86,66 @@ rte_driver_name(const struct rte_driver *driver);
/**
* Retrieve a device bus.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A pointer to this device bus.
*/
-__rte_experimental
const struct rte_bus *
rte_dev_bus(const struct rte_device *dev);
/**
* Retrieve bus specific information for a device.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A string describing this device or NULL if none is available.
*/
-__rte_experimental
const char *
rte_dev_bus_info(const struct rte_device *dev);
/**
* Retrieve a device arguments.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A pointer to this device devargs.
*/
-__rte_experimental
const struct rte_devargs *
rte_dev_devargs(const struct rte_device *dev);
/**
* Retrieve a device driver.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A pointer to this device driver.
*/
-__rte_experimental
const struct rte_driver *
rte_dev_driver(const struct rte_device *dev);
/**
* Retrieve a device name.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A pointer to this device name.
*/
-__rte_experimental
const char *
rte_dev_name(const struct rte_device *dev);
/**
* Retrieve a device numa node.
*
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* @param dev
* A pointer to a device structure.
* @return
* A pointer to this device numa node.
*/
-__rte_experimental
int
rte_dev_numa_node(const struct rte_device *dev);
@@ -179,19 +155,6 @@ rte_dev_numa_node(const struct rte_device *dev);
*/
#define RTE_DEV_NAME_MAX_LEN 64
-/**
- * A structure describing a generic device.
- */
-struct rte_device {
- RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */
- const char *name; /**< Device name */
- const char *bus_info; /**< Device bus specific information */
- const struct rte_driver *driver; /**< Driver assigned after probing */
- const struct rte_bus *bus; /**< Bus handle assigned on scan */
- int numa_node; /**< NUMA node connection */
- struct rte_devargs *devargs; /**< Arguments for latest probing */
-};
-
/**
* Query status of a device.
*
@@ -26,7 +26,13 @@ DPDK_23 {
rte_delay_us_block;
rte_delay_us_callback_register;
rte_delay_us_sleep;
+ rte_dev_bus;
+ rte_dev_bus_info;
+ rte_dev_devargs;
+ rte_dev_driver;
rte_dev_is_probed;
+ rte_dev_name;
+ rte_dev_numa_node;
rte_dev_probe;
rte_dev_remove;
rte_devargs_add;
@@ -424,14 +430,6 @@ EXPERIMENTAL {
rte_thread_self;
rte_thread_set_affinity_by_id;
rte_thread_set_priority;
-
- # added in 22.11
- rte_dev_bus;
- rte_dev_bus_info;
- rte_dev_devargs;
- rte_dev_driver;
- rte_dev_name;
- rte_dev_numa_node;
};
INTERNAL {
@@ -10,6 +10,7 @@
#include <sys/queue.h>
+#include <dev_driver.h>
#include <rte_class.h>
#include <rte_malloc.h>
#include <rte_spinlock.h>