dpdk: fix hugepage pre-alloc 18/15518/2
authorDamjan Marion <damarion@cisco.com>
Wed, 24 Oct 2018 21:21:32 +0000 (23:21 +0200)
committerDamjan Marion <dmarion@me.com>
Wed, 24 Oct 2018 22:41:06 +0000 (22:41 +0000)
Change-Id: I88577615bfd3cddca834a7b881979ab32bfd5574
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/dpdk/device/init.c

index b9b3b15..9c54641 100644 (file)
@@ -1291,7 +1291,8 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
          clib_error_t *e;
          uword n_pages;
          vec_validate(mem_by_socket, c);
-         n_pages = round_pow2 (mem_by_socket[c], default_hugepage_sz);
+         n_pages = round_pow2 ((uword) mem_by_socket[c]<<20,
+                               default_hugepage_sz);
          n_pages /= default_hugepage_sz;
 
          if ((e = clib_sysfs_prealloc_hugepages(c, 0, n_pages)))