summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlejandro Lucero <alejandro.lucero@netronome.com>2018-11-01 19:53:24 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-11-05 01:01:43 +0100
commitaf0aa2357d94f4210e679835138cb911d4d55f1c (patch)
tree8a5ec19c433410579a7bc6015b08cca470f48895 /lib
parentf090c23a04fa36b0114644368f6b0b75ef1198bf (diff)
downloaddpdk-af0aa2357d94f4210e679835138cb911d4d55f1c.zip
dpdk-af0aa2357d94f4210e679835138cb911d4d55f1c.tar.gz
dpdk-af0aa2357d94f4210e679835138cb911d4d55f1c.tar.xz
malloc: fix DMA mask check
The param needs to be the maskbits and not the mask. Fixes: 223b7f1d5ef6 ("mem: add function for checking memseg IOVA") Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/common/malloc_heap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c
index 1973b6e..d1019e3 100644
--- a/lib/librte_eal/common/malloc_heap.c
+++ b/lib/librte_eal/common/malloc_heap.c
@@ -294,7 +294,6 @@ alloc_pages_on_heap(struct malloc_heap *heap, uint64_t pg_sz, size_t elt_size,
size_t alloc_sz;
int allocd_pages;
void *ret, *map_addr;
- uint64_t mask;
alloc_sz = (size_t)pg_sz * n_segs;
@@ -323,8 +322,7 @@ alloc_pages_on_heap(struct malloc_heap *heap, uint64_t pg_sz, size_t elt_size,
}
if (mcfg->dma_maskbits) {
- mask = ~((1ULL << mcfg->dma_maskbits) - 1);
- if (rte_eal_check_dma_mask(mask)) {
+ if (rte_eal_check_dma_mask(mcfg->dma_maskbits)) {
RTE_LOG(ERR, EAL,
"%s(): couldn't allocate memory due to DMA mask\n",
__func__);