New upstream version 17.11.1
[deb_dpdk.git] / lib / librte_eal / common / include / rte_eal.h
index abf020b..78b0e00 100644 (file)
 #include <stdint.h>
 #include <sched.h>
 
-#include <rte_per_lcore.h>
 #include <rte_config.h>
+#include <rte_per_lcore.h>
+#include <rte_bus.h>
+
+#include <rte_pci_dev_feature_defs.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,6 +64,7 @@ extern "C" {
 enum rte_lcore_role_t {
        ROLE_RTE,
        ROLE_OFF,
+       ROLE_SERVICE,
 };
 
 /**
@@ -80,11 +84,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
@@ -185,6 +193,8 @@ int rte_eal_iopl_init(void);
  *
  *     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);
 
@@ -208,7 +218,7 @@ int rte_eal_primary_proc_alive(const char *config_file_path);
 /**
  * Usage function typedef used by the application usage function.
  *
- * Use this function typedef to define and call rte_set_applcation_usage_hook()
+ * Use this function typedef to define and call rte_set_application_usage_hook()
  * routine.
  */
 typedef void   (*rte_usage_hook_t)(const char * prgname);
@@ -259,6 +269,32 @@ rte_set_application_usage_hook(rte_usage_hook_t usage_func);
  */
 int rte_eal_has_hugepages(void);
 
+/**
+ * Whether EAL is using PCI bus.
+ * Disabled by --no-pci option.
+ *
+ * @return
+ *   Nonzero if the PCI bus is enabled.
+ */
+int rte_eal_has_pci(void);
+
+/**
+ * Whether the EAL was asked to create UIO device.
+ *
+ * @return
+ *   Nonzero if true.
+ */
+int rte_eal_create_uio_dev(void);
+
+/**
+ * The user-configured vfio interrupt mode.
+ *
+ * @return
+ *   Interrupt mode configured with the command line,
+ *   RTE_INTR_MODE_NONE by default.
+ */
+enum rte_intr_mode rte_eal_vfio_intr_mode(void);
+
 /**
  * A wrap API for syscall gettid.
  *
@@ -283,8 +319,22 @@ static inline int rte_gettid(void)
        return RTE_PER_LCORE(_thread_id);
 }
 
-#define RTE_INIT(func) \
-static void __attribute__((constructor, used)) func(void)
+/**
+ * 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);
 
 #ifdef __cplusplus
 }