X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal.c;h=5f9032c5757fe190feda150cffe446c985b1aa61;hb=aec9c13c5257f0dae350152fa0444634fe35859e;hp=02381d0d15e131a5a15fb9ed3b24c413d6a0559b;hpb=229f351a639f846fc688d873747c863346102ea1;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 02381d0d15..5f9032c575 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -71,12 +70,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include "eal_private.h" #include "eal_thread.h" @@ -125,7 +124,7 @@ int rte_cycles_vmware_tsc_map; const char * rte_eal_mbuf_default_mempool_ops(void) { - return internal_config.mbuf_pool_ops_name; + return internal_config.user_mbuf_pool_ops_name; } /* Return a pointer to the configuration structure */ @@ -610,7 +609,7 @@ eal_parse_args(int argc, char **argv) break; case OPT_MBUF_POOL_OPS_NAME_NUM: - internal_config.mbuf_pool_ops_name = optarg; + internal_config.user_mbuf_pool_ops_name = optarg; break; default: @@ -710,14 +709,9 @@ static int rte_eal_vfio_setup(void) { int vfio_enabled = 0; - if (vfio_enable("vfio")) + if (rte_vfio_enable("vfio")) return -1; - vfio_enabled = vfio_is_enabled("vfio"); - - if (!internal_config.no_pci) { - if (!pci_vfio_is_enabled()) - RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n"); - } + vfio_enabled = rte_vfio_is_enabled("vfio"); if (vfio_enabled) { @@ -813,6 +807,15 @@ rte_eal_init(int argc, char **argv) /* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); + /* Workaround for KNI which requires physical address to work */ + if (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA && + rte_eal_check_module("rte_kni") == 1) { + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; + RTE_LOG(WARNING, EAL, + "Some devices want IOVA as VA but PA will be used because.. " + "KNI module inserted\n"); + } + if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && eal_hugepage_info_init() < 0) { @@ -971,6 +974,12 @@ rte_eal_init(int argc, char **argv) return fctret; } +int rte_eal_cleanup(void) +{ + rte_service_finalize(); + return 0; +} + /* get core role */ enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id) @@ -989,6 +998,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) {