Commit 0e00e243 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

memory: don't allocate numa node map in no-huge mode



DPDK doesn't report numa nodes for 4KB pages, so we can skip this map
and always return SPDK_ENV_NUMA_ID_ANY in this case.

Change-Id: Iccbf0c95920c0ed14f7152dc2e5096b054e44d09
Signed-off-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26245


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
parent 03b3b8bb
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1965,12 +1965,14 @@ vtophys_init(void)
		return -ENOMEM;
	}

	if (g_huge_pages) {
		g_numa_map = spdk_mem_map_alloc(SPDK_ENV_NUMA_ID_ANY, &numa_map_ops, NULL);
		if (g_numa_map == NULL) {
			DEBUG_PRINT("numa map allocation failed.\n");
			spdk_mem_map_free(&g_phys_ref_map);
			return -ENOMEM;
		}
	}

	g_vtophys_map = spdk_mem_map_alloc(SPDK_VTOPHYS_ERROR, &vtophys_map_ops, NULL);
	if (g_vtophys_map == NULL) {
@@ -2009,6 +2011,10 @@ spdk_vtophys(const void *buf, uint64_t *size)
int32_t
spdk_mem_get_numa_id(const void *buf, uint64_t *size)
{
	if (!g_numa_map) {
		return SPDK_ENV_NUMA_ID_ANY;
	}

	return spdk_mem_map_translate(g_numa_map, (uint64_t)buf, size);
}