From 20836de289eafdb607d918c3e0c02b21e6985510 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 5 Jul 2018 04:46:23 -0700 Subject: [PATCH] env_dpdk: move 2MB alignment comment to correct position Signed-off-by: Jim Harris Change-Id: Ia413a913857dad00ae091b8cea02a647b8996a5c Reviewed-on: https://review.gerrithub.io/418108 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker --- lib/env_dpdk/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/env_dpdk/memory.c b/lib/env_dpdk/memory.c index eb5404099..0e9973e1a 100644 --- a/lib/env_dpdk/memory.c +++ b/lib/env_dpdk/memory.c @@ -398,12 +398,12 @@ spdk_mem_map_set_translation(struct spdk_mem_map *map, uint64_t vaddr, uint64_t uint64_t idx_1gb; struct map_2mb *map_2mb; - /* For now, only 2 MB-aligned registrations are supported */ if ((uintptr_t)vaddr & ~MASK_256TB) { DEBUG_PRINT("invalid usermode virtual address %lu\n", vaddr); return -EINVAL; } + /* For now, only 2 MB-aligned registrations are supported */ if (((uintptr_t)vaddr & MASK_2MB) || (size & MASK_2MB)) { DEBUG_PRINT("invalid %s parameters, vaddr=%lu len=%ju\n", __func__, vaddr, size); @@ -438,12 +438,12 @@ spdk_mem_map_clear_translation(struct spdk_mem_map *map, uint64_t vaddr, uint64_ uint64_t idx_1gb; struct map_2mb *map_2mb; - /* For now, only 2 MB-aligned registrations are supported */ if ((uintptr_t)vaddr & ~MASK_256TB) { DEBUG_PRINT("invalid usermode virtual address %lu\n", vaddr); return -EINVAL; } + /* For now, only 2 MB-aligned registrations are supported */ if (((uintptr_t)vaddr & MASK_2MB) || (size & MASK_2MB)) { DEBUG_PRINT("invalid %s parameters, vaddr=%lu len=%ju\n", __func__, vaddr, size);