eal: allow user to override default mempool driver
[dpdk.git] / lib / librte_eal / common / include / rte_eal.h
index 03fee50..4ea2ff4 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <rte_per_lcore.h>
 #include <rte_config.h>
+#include <rte_bus.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,6 +62,7 @@ extern "C" {
 enum rte_lcore_role_t {
        ROLE_RTE,
        ROLE_OFF,
+       ROLE_SERVICE,
 };
 
 /**
@@ -80,11 +82,15 @@ enum rte_proc_type_t {
 struct rte_config {
        uint32_t master_lcore;       /**< Id of the master lcore */
        uint32_t lcore_count;        /**< Number of available logical cores. */
+       uint32_t service_lcore_count;/**< Number of available service cores. */
        enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */
 
        /** Primary or secondary configuration */
        enum rte_proc_type_t process_type;
 
+       /** PA or VA mapping mode */
+       enum rte_iova_mode iova_mode;
+
        /**
         * Pointer to memory configuration, which may be shared across multiple
         * DPDK instances
@@ -159,7 +165,34 @@ int rte_eal_iopl_init(void);
  *     function call and should not be further interpreted by the
  *     application.  The EAL does not take any ownership of the memory used
  *     for either the argv array, or its members.
- *   - On failure, a negative error value.
+ *   - On failure, -1 and rte_errno is set to a value indicating the cause
+ *     for failure.  In some instances, the application will need to be
+ *     restarted as part of clearing the issue.
+ *
+ *   Error codes returned via rte_errno:
+ *     EACCES indicates a permissions issue.
+ *
+ *     EAGAIN indicates either a bus or system resource was not available,
+ *            setup may be attempted again.
+ *
+ *     EALREADY indicates that the rte_eal_init function has already been
+ *              called, and cannot be called again.
+ *
+ *     EFAULT indicates the tailq configuration name was not found in
+ *            memory configuration.
+ *
+ *     EINVAL indicates invalid parameters were passed as argv/argc.
+ *
+ *     ENOMEM indicates failure likely caused by an out-of-memory condition.
+ *
+ *     ENODEV indicates memory setup issues.
+ *
+ *     ENOTSUP indicates that the EAL cannot initialize on this system.
+ *
+ *     EPROTO indicates that the PCI bus is either not present, or is not
+ *            readable by the eal.
+ *
+ *     ENOEXEC indicates that a service core failed to launch successfully.
  */
 int rte_eal_init(int argc, char **argv);
 
@@ -258,9 +291,46 @@ static inline int rte_gettid(void)
        return RTE_PER_LCORE(_thread_id);
 }
 
+/**
+ * Get the iova mode
+ *
+ * @return
+ *   enum rte_iova_mode value.
+ */
+enum rte_iova_mode rte_eal_iova_mode(void);
+
+/**
+ * Get default pool ops name for mbuf
+ *
+ * @return
+ *   returns default pool ops name.
+ */
+const char *
+rte_eal_mbuf_default_mempool_ops(void);
+
+/**
+ * Run function before main() with low priority.
+ *
+ * The constructor will be run after prioritized constructors.
+ *
+ * @param func
+ *   Constructor function.
+ */
 #define RTE_INIT(func) \
 static void __attribute__((constructor, used)) func(void)
 
+/**
+ * Run function before main() with high priority.
+ *
+ * @param func
+ *   Constructor function.
+ * @param prio
+ *   Priority number must be above 100.
+ *   Lowest number is the first to run.
+ */
+#define RTE_INIT_PRIO(func, prio) \
+static void __attribute__((constructor(prio), used)) func(void)
+
 #ifdef __cplusplus
 }
 #endif