[RFC,v2,v2,29/29] 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.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/eal/common/eal_private.h | 2 +-
lib/eal/include/dev_driver.h | 14 ++++++++++++++
lib/eal/include/rte_dev.h | 13 +------------
lib/vhost/vdpa.c | 1 +
4 files changed, 17 insertions(+), 13 deletions(-)
@@ -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>
@@ -12,6 +12,8 @@ extern "C" {
#include <rte_common.h>
#include <rte_dev.h>
+struct rte_devargs;
+
/**
* A structure describing a device driver.
*/
@@ -21,6 +23,18 @@ 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 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
@@ -25,6 +25,7 @@ extern "C" {
struct rte_bus;
struct rte_driver;
+struct rte_device;
/**
* The device event type.
@@ -127,18 +128,6 @@ __rte_experimental
int
rte_dev_numa_node(const struct rte_device *dev);
-/**
- * A structure describing a generic device.
- */
-struct rte_device {
- RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */
- const char *name; /**< Device name */
- 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.
*
@@ -10,6 +10,7 @@
#include <sys/queue.h>
+#include <dev_driver.h>
#include <rte_common.h>
#include <rte_class.h>
#include <rte_malloc.h>