Fix buffer leak from L2 flooding replication process
[vpp.git] / svm / svm.h
index 95c5500..bca2379 100644 (file)
--- a/svm/svm.h
+++ b/svm/svm.h
@@ -25,7 +25,7 @@
 #include <vppinfra/clib.h>
 #include <vppinfra/mem.h>
 
-#define MMAP_PAGESIZE (4<<10)
+#define MMAP_PAGESIZE (clib_mem_get_page_size())
 
 #define SVM_VERSION ((1<<16) | 1) /* set to declare region ready. */
 
@@ -34,7 +34,7 @@
 #define SVM_FLAGS_NODATA (1<<2)  /* region will be further subdivided */
 #define SVM_FLAGS_NEED_DATA_INIT (1<<3) 
 
-#define SVM_PVT_MHEAP_SIZE (32<<10) /* region's private mheap (32k) */
+#define SVM_PVT_MHEAP_SIZE (128<<10) /* region's private mheap (128k) */
 
 typedef struct svm_region_ {
     volatile uword version;
@@ -74,6 +74,9 @@ typedef struct svm_map_region_args_ {
     uword flags;
     char *backing_file;
     uword backing_mmap_size;
+    /* uid, gid to own the svm region(s) */
+    int uid;
+    int gid;
 } svm_map_region_args_t;
 
 
@@ -108,6 +111,7 @@ typedef struct {
 void *svm_region_find_or_create (svm_map_region_args_t *a);
 void svm_region_init(void);
 void svm_region_init_chroot(char *root_path);
+void svm_region_init_chroot_uid_gid(char *root_path, int uid, int gid);
 void svm_region_exit (void);
 void svm_region_unmap(void *rp_arg);
 void svm_client_scan (char *root_path);