X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=svm%2Fsvmtool.c;h=b319551425c92c7cd8405a1f6af49b879b4b8b15;hb=019481ba1d2d6e5b82a98f10d7d6d4bdab9e8380;hp=c37afbd152c28b4d89ffaaa410964897f7427f61;hpb=8a7fb0cf6844ed09173fd58224f7753a1b504cf4;p=vpp.git diff --git a/svm/svmtool.c b/svm/svmtool.c index c37afbd152c..b319551425c 100644 --- a/svm/svmtool.c +++ b/svm/svmtool.c @@ -164,6 +164,7 @@ svm_map_region_nolock (svm_map_region_args_t * a) if (rp->version == 0) { clib_warning ("rp->version %d not %d", rp->version, SVM_VERSION); + munmap (rp, MMAP_PAGESIZE); return (0); } /* Remap now that the region has been placed */ @@ -205,10 +206,10 @@ svm_map_region_nolock (svm_map_region_args_t * a) * rnd_pagesize * Round to a pagesize multiple, presumably 4k works */ -static unsigned int -rnd_pagesize (unsigned int size) +static u64 +rnd_pagesize (u64 size) { - unsigned int rv; + u64 rv; rv = (size + (MMAP_PAGESIZE - 1)) & ~(MMAP_PAGESIZE - 1); return (rv); @@ -246,7 +247,8 @@ svm_existing_region_map_nolock (void *root_arg, svm_map_region_args_t * a) void *oldheap; uword *p; - a->size += MMAP_PAGESIZE + SVM_PVT_MHEAP_SIZE; + a->size += MMAP_PAGESIZE + + (a->pvt_heap_size ? a->pvt_heap_size : SVM_PVT_MHEAP_SIZE); a->size = rnd_pagesize (a->size); region_lock (root_rp, 4);