summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/buffer.c2
-rwxr-xr-xsrc/vlib/linux/physmem.c2
-rw-r--r--src/vlib/linux/vfio.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index a704efb40f4..785fa9b8aac 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -910,7 +910,7 @@ vlib_buffer_pool_create (vlib_main_t * vm, vlib_physmem_region_index_t pri,
p->log2_page_size = pr->log2_page_size;
p->buffer_size = buffer_size;
- p->buffers_per_page = (1 << pr->log2_page_size) / p->buffer_size;
+ p->buffers_per_page = (1ull << pr->log2_page_size) / p->buffer_size;
p->n_elts = p->buffers_per_page * pr->n_pages;
p->n_used = 0;
clib_spinlock_init (&p->lock);
diff --git a/src/vlib/linux/physmem.c b/src/vlib/linux/physmem.c
index 4d16486dea1..dbc4c549a99 100755
--- a/src/vlib/linux/physmem.c
+++ b/src/vlib/linux/physmem.c
@@ -179,7 +179,7 @@ unix_physmem_region_alloc (vlib_main_t * vm, char *name, u32 size,
pr->log2_page_size = alloc.log2_page_size;
pr->n_pages = alloc.n_pages;
pr->size = (u64) pr->n_pages << (u64) pr->log2_page_size;
- pr->page_mask = (1 << pr->log2_page_size) - 1;
+ pr->page_mask = (1ull << pr->log2_page_size) - 1;
pr->numa_node = numa_node;
pr->name = format (0, "%s%c", name, 0);
diff --git a/src/vlib/linux/vfio.c b/src/vlib/linux/vfio.c
index 02262719e82..ffc990a61d2 100644
--- a/src/vlib/linux/vfio.c
+++ b/src/vlib/linux/vfio.c
@@ -52,8 +52,8 @@ vfio_map_regions (vlib_main_t * vm, int fd)
vec_foreach_index (i, pr->page_table)
{
int rv;
- dm.vaddr = pointer_to_uword (pr->mem) + (i << pr->log2_page_size);
- dm.size = 1 << pr->log2_page_size;
+ dm.vaddr = pointer_to_uword (pr->mem) + ((u64)i << pr->log2_page_size);
+ dm.size = 1ull << pr->log2_page_size;
dm.iova = dm.vaddr;
vlib_log_debug (lvm->log_default, "map DMA va:0x%lx iova:%lx "
"size:0x%lx", dm.vaddr, dm.iova, dm.size);