diff options
author | Florin Coras <fcoras@cisco.com> | 2018-01-14 12:25:50 -0800 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-01-15 16:39:12 +0000 |
commit | 4d9b9d8e74f12a26404ccdd8baf46c61b44584db (patch) | |
tree | 2c9e0314664fca52722431f14928e1b3fd0017fb /src/svm/ssvm.h | |
parent | 149a1433b0e6301a34989f5e8c7ebed3fa5bf74e (diff) |
svm: refactor memfd and remove ssvm_eth
Change-Id: Icde296e956eb89ea3a17d547f04a833916ec6440
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/ssvm.h')
-rw-r--r-- | src/svm/ssvm.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/svm/ssvm.h b/src/svm/ssvm.h index 8466e15579b..0295e302e72 100644 --- a/src/svm/ssvm.h +++ b/src/svm/ssvm.h @@ -37,6 +37,7 @@ #include <vppinfra/heap.h> #include <vppinfra/pool.h> #include <vppinfra/format.h> +#include <vppinfra/linux/syscall.h> #ifndef MMAP_PAGESIZE #define MMAP_PAGESIZE (clib_mem_get_page_size()) @@ -76,12 +77,12 @@ typedef struct ssvm_shared_header_t *sh; u64 ssvm_size; u32 my_pid; - u32 vlib_hw_if_index; u8 *name; uword requested_va; int i_am_master; - u32 per_interface_next_index; - u32 *rx_queue; + + /* Needed by memfd segments */ + int fd; } ssvm_private_t; always_inline void @@ -165,6 +166,24 @@ int ssvm_master_init (ssvm_private_t * ssvm, u32 master_index); int ssvm_slave_init (ssvm_private_t * ssvm, int timeout_in_seconds); void ssvm_delete (ssvm_private_t * ssvm); +int ssvm_master_init_memfd (ssvm_private_t * memfd, u32 master_index); +int ssvm_slave_init_memfd (ssvm_private_t * memfd); +void memfd_delete (ssvm_private_t * memfd); + +/* These do not belong here, but the original keeps running around... */ +/* $$$$ work w/ Damjan to fix properly */ +#ifndef F_LINUX_SPECIFIC_BASE +#define F_LINUX_SPECIFIC_BASE 1024 +#endif +#define MFD_ALLOW_SEALING 0x0002U +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) +#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) + +#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ +#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ +#define F_SEAL_GROW 0x0004 /* prevent file from growing */ +#define F_SEAL_WRITE 0x0008 /* prevent writes */ + #endif /* __included_ssvm_h__ */ /* |