From 3289ab6d93e1477455ce4f632e44b2ad2f26f755 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Fri, 15 Jan 2021 14:03:01 +0300 Subject: [PATCH] rdma: Remove check for translation length With min supported DPDK >= 19.11 there is no need to check that the buffer can be split over several Memory Regions so we can remove this check. Keep assert that translation length is not less than request as a sanity check. Change-Id: If61e673ecde28bbda8eb57a2768085715bed141a Signed-off-by: Alexey Marchuk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5938 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- include/spdk_internal/rdma.h | 1 - lib/rdma/common.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/spdk_internal/rdma.h b/include/spdk_internal/rdma.h index bf58de05e..01772f933 100644 --- a/include/spdk_internal/rdma.h +++ b/include/spdk_internal/rdma.h @@ -162,7 +162,6 @@ void spdk_rdma_free_mem_map(struct spdk_rdma_mem_map **map); * \param length Length of the memory address * \param[in,out] translation Pointer to translation result to be filled by this function * \retval -EINVAL if translation is not found - * \retval -ERANGE if requested address + length crosses Memory Region boundary * \retval 0 translation succeed */ int spdk_rdma_get_translation(struct spdk_rdma_mem_map *map, void *address, diff --git a/lib/rdma/common.c b/lib/rdma/common.c index 21bd51061..0bd30183c 100644 --- a/lib/rdma/common.c +++ b/lib/rdma/common.c @@ -213,10 +213,7 @@ spdk_rdma_get_translation(struct spdk_rdma_mem_map *map, void *address, } } - if (spdk_unlikely(real_length < length)) { - SPDK_ERRLOG("Data buffer %p length %zu split over multiple RDMA Memory Regions\n", address, length); - return -ERANGE; - } + assert(real_length >= length); return 0; }