From: Anatoly Burakov Date: Mon, 9 Nov 2020 15:47:48 +0000 (+0000) Subject: mem: quiet base address hint warning if not requested X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4042dc2037a1509596f7eb48370185434bad39cc;p=dpdk.git mem: quiet base address hint warning if not requested Any EAL memory allocation often goes through eal_get_virtual_area() function, which will print a warning whenever the resulting allocation didn't match the specified address requirements. This is useful for when we have requested a specific base virtual address, to let the user know that the mapping has deviated from that address. However, on Linux, we also have a default base address that's there to ensure better chances of successful secondary process initialization, as well as higher likelihood of the virtual areas to fit inside the IOMMU address width. Because of this default base address, there are warnings printed even when no base address was explicitly requested, which can be confusing to the user. Emit this warning with debug level unless base address was explicitly requested by the user. Signed-off-by: Anatoly Burakov --- diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c index 616db5ce31..88517fd69e 100644 --- a/lib/eal/common/eal_common_memory.c +++ b/lib/eal/common/eal_common_memory.c @@ -143,9 +143,19 @@ eal_get_virtual_area(void *requested_addr, size_t *size, return NULL; } else if (requested_addr != NULL && addr_is_hint && aligned_addr != requested_addr) { - RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", - requested_addr, aligned_addr); - RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); + /* + * demote this warning to debug if we did not explicitly request + * a base virtual address. + */ + if (internal_conf->base_virtaddr != 0) { + RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", + requested_addr, aligned_addr); + RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); + } else { + RTE_LOG(DEBUG, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", + requested_addr, aligned_addr); + RTE_LOG(DEBUG, EAL, " This may cause issues with mapping memory into secondary processes\n"); + } } else if (next_baseaddr != NULL) { next_baseaddr = RTE_PTR_ADD(aligned_addr, *size); }