eal: add function to release internal resources
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal.c
index 0c36b76..5f9032c 100644 (file)
@@ -56,7 +56,6 @@
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
-#include <rte_memzone.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.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:
@@ -808,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) {
@@ -966,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)