[dpdk-dev,v7,06/25] eal: expose internal config elements
Checks
Commit Message
Some internal configuration elements set by the user on the command line
are necessary outside the EAL, when the PCI bus is detached.
Expose:
+ rte_eal_create_uio_dev
+ rte_eal_has_pci
+ rte_eal_vfio_intr_mode
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
lib/librte_eal/bsdapp/eal/eal.c | 16 ++++++++++++++++
lib/librte_eal/common/include/rte_eal.h | 28 ++++++++++++++++++++++++++++
lib/librte_eal/linuxapp/eal/eal.c | 16 ++++++++++++++++
lib/librte_eal/rte_eal_version.map | 3 +++
4 files changed, 63 insertions(+)
@@ -723,3 +723,19 @@ rte_eal_process_type(void)
{
return rte_config.process_type;
}
+
+int rte_eal_has_pci(void)
+{
+ return !internal_config.no_pci;
+}
+
+int rte_eal_create_uio_dev(void)
+{
+ return internal_config.create_uio_dev;
+}
+
+enum rte_intr_mode
+rte_eal_vfio_intr_mode(void)
+{
+ return RTE_INTR_MODE_NONE;
+}
@@ -47,6 +47,8 @@
#include <rte_config.h>
#include <rte_bus.h>
+#include <rte_pci_dev_feature_defs.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -268,6 +270,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.
*
* @return
@@ -989,6 +989,22 @@ int rte_eal_has_hugepages(void)
return ! internal_config.no_hugetlbfs;
}
+int rte_eal_has_pci(void)
+{
+ return !internal_config.no_pci;
+}
+
+int rte_eal_create_uio_dev(void)
+{
+ return internal_config.create_uio_dev;
+}
+
+enum rte_intr_mode
+rte_eal_vfio_intr_mode(void)
+{
+ return internal_config.vfio_intr_mode;
+}
+
int
rte_eal_check_module(const char *module_name)
{
@@ -241,10 +241,13 @@ EXPERIMENTAL {
DPDK_17.11 {
global:
+ rte_eal_create_uio_dev;
rte_bus_get_iommu_class;
+ rte_eal_has_pci;
rte_eal_iova_mode;
rte_eal_mbuf_default_mempool_ops;
rte_eal_using_phys_addrs;
+ rte_eal_vfio_intr_mode;
rte_lcore_has_role;
rte_memcpy_ptr;
rte_pci_get_iommu_class;