X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Feal%2Ffreebsd%2Feal.c;h=5cea368efe35fed22bea787f066e5eebb8d0bcbf;hb=bf8b792f3b8519fecf3585ffac15da6f7bca2de9;hp=f4d1676754948cf95bc680deebbeded6249d40be;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index f4d1676754..5cea368efe 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -575,12 +575,14 @@ eal_parse_args(int argc, char **argv) } } - /* create runtime data directory */ - if (internal_conf->no_shconf == 0 && - eal_create_runtime_dir() < 0) { - RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); - ret = -1; - goto out; + /* create runtime data directory. In no_shconf mode, skip any errors */ + if (eal_create_runtime_dir() < 0) { + if (internal_conf->no_shconf == 0) { + RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); + ret = -1; + goto out; + } else + RTE_LOG(WARNING, EAL, "No DPDK runtime directory created\n"); } if (eal_adjust_config(internal_conf) != 0) { @@ -675,6 +677,8 @@ rte_eal_init(int argc, char **argv) const struct rte_config *config = rte_eal_get_configuration(); struct internal_config *internal_conf = eal_get_internal_configuration(); + bool has_phys_addr; + enum rte_iova_mode iova_mode; /* checks if the machine is adequate */ if (!rte_cpu_is_supported()) { @@ -716,6 +720,10 @@ rte_eal_init(int argc, char **argv) /* FreeBSD always uses legacy memory model */ internal_conf->legacy_mem = true; + if (internal_conf->in_memory) { + RTE_LOG(WARNING, EAL, "Warning: ignoring unsupported flag, '%s'\n", OPT_IN_MEMORY); + internal_conf->in_memory = false; + } if (eal_plugins_init() < 0) { rte_eal_init_alert("Cannot init plugins"); @@ -771,19 +779,30 @@ rte_eal_init(int argc, char **argv) return -1; } - /* if no EAL option "--iova-mode=", use bus IOVA scheme */ - if (internal_conf->iova_mode == RTE_IOVA_DC) { - /* autodetect the IOVA mapping mode (default is RTE_IOVA_PA) */ - enum rte_iova_mode iova_mode = rte_bus_get_iommu_class(); - - if (iova_mode == RTE_IOVA_DC) - iova_mode = RTE_IOVA_PA; - rte_eal_get_configuration()->iova_mode = iova_mode; - } else { - rte_eal_get_configuration()->iova_mode = - internal_conf->iova_mode; + /* + * PA are only available for hugepages via contigmem. + * If contigmem is inaccessible, rte_eal_hugepage_init() will fail + * with a message describing the cause. + */ + has_phys_addr = internal_conf->no_hugetlbfs == 0; + iova_mode = internal_conf->iova_mode; + if (iova_mode == RTE_IOVA_PA && !has_phys_addr) { + rte_eal_init_alert("Cannot use IOVA as 'PA' since physical addresses are not available"); + rte_errno = EINVAL; + return -1; } - + if (iova_mode == RTE_IOVA_DC) { + RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n"); + if (has_phys_addr) { + RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n"); + iova_mode = rte_bus_get_iommu_class(); + if (iova_mode == RTE_IOVA_DC) + iova_mode = RTE_IOVA_PA; + } else { + iova_mode = RTE_IOVA_VA; + } + } + rte_eal_get_configuration()->iova_mode = iova_mode; RTE_LOG(INFO, EAL, "Selected IOVA mode '%s'\n", rte_eal_iova_mode() == RTE_IOVA_PA ? "PA" : "VA"); @@ -944,7 +963,7 @@ rte_eal_init(int argc, char **argv) rte_eal_init_alert("Cannot clear runtime directory"); return -1; } - if (!internal_conf->no_telemetry) { + if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) { int tlog = rte_log_register_type_and_pick_level( "lib.telemetry", RTE_LOG_WARNING); if (tlog < 0) @@ -969,6 +988,7 @@ rte_eal_cleanup(void) rte_mp_channel_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); + rte_eal_alarm_cleanup(); rte_trace_save(); eal_trace_fini(); eal_cleanup_config(internal_conf); @@ -1025,7 +1045,7 @@ int rte_vfio_noiommu_is_enabled(void) int rte_vfio_clear_group(__rte_unused int vfio_group_fd) { - return 0; + return -1; } int