X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Feal%2Fwindows%2Feal.c;h=67db7f099a0a962d67c75ae1cc8124c06246d59c;hb=4042dc2037a1509596f7eb48370185434bad39cc;hp=8483f6b02c6a2188ba4c38cb0ea3a2bbaae78190;hpb=cfdaa678b3bbff51fe152c18621c751867c70bd2;p=dpdk.git diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index 8483f6b02c..67db7f099a 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -22,6 +22,7 @@ #include #include +#include "eal_firmware.h" #include "eal_hugepages.h" #include "eal_trace.h" #include "eal_log.h" @@ -260,6 +261,7 @@ rte_eal_cleanup(void) eal_get_internal_configuration(); eal_intr_thread_cancel(); + eal_mem_virt2iova_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); eal_cleanup_config(internal_conf); @@ -274,6 +276,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; int ret; eal_log_init(NULL, 0); @@ -320,17 +324,58 @@ rte_eal_init(int argc, char **argv) internal_conf->memory = MEMSIZE_IF_NO_HUGE_PAGE; } + if (rte_eal_intr_init() < 0) { + rte_eal_init_alert("Cannot init interrupt-handling thread"); + return -1; + } + + if (rte_eal_timer_init() < 0) { + rte_eal_init_alert("Cannot init TSC timer"); + rte_errno = EFAULT; + return -1; + } + + bscan = rte_bus_scan(); + if (bscan < 0) { + rte_eal_init_alert("Cannot scan the buses"); + rte_errno = ENODEV; + return -1; + } + if (eal_mem_win32api_init() < 0) { rte_eal_init_alert("Cannot access Win32 memory management"); rte_errno = ENOTSUP; return -1; } + has_phys_addr = true; if (eal_mem_virt2iova_init() < 0) { /* Non-fatal error if physical addresses are not required. */ - RTE_LOG(WARNING, EAL, "Cannot access virt2phys driver, " + RTE_LOG(DEBUG, EAL, "Cannot access virt2phys driver, " "PA will not be available\n"); + has_phys_addr = false; + } + + 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_LOG(DEBUG, EAL, "Selected IOVA mode '%s'\n", + iova_mode == RTE_IOVA_PA ? "PA" : "VA"); + rte_eal_get_configuration()->iova_mode = iova_mode; if (rte_eal_memzone_init() < 0) { rte_eal_init_alert("Cannot init memzone"); @@ -356,27 +401,9 @@ rte_eal_init(int argc, char **argv) return -1; } - if (rte_eal_intr_init() < 0) { - rte_eal_init_alert("Cannot init interrupt-handling thread"); - return -1; - } - - if (rte_eal_timer_init() < 0) { - rte_eal_init_alert("Cannot init TSC timer"); - rte_errno = EFAULT; - return -1; - } - __rte_thread_init(config->main_lcore, &lcore_config[config->main_lcore].cpuset); - bscan = rte_bus_scan(); - if (bscan < 0) { - rte_eal_init_alert("Cannot init PCI"); - rte_errno = ENODEV; - return -1; - } - RTE_LCORE_FOREACH_WORKER(i) { /* @@ -454,6 +481,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, __rte_unused uint64_t iova, __rte_unused uint64_t len) { + rte_errno = ENOTSUP; return -1; } @@ -462,6 +490,15 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, __rte_unused uint64_t vaddr, __rte_unused uint64_t iova, __rte_unused uint64_t len) +{ + rte_errno = ENOTSUP; + return -1; +} + +int +rte_firmware_read(__rte_unused const char *name, + __rte_unused void **buf, + __rte_unused size_t *bufsz) { return -1; }