diff options
author | Florin Coras <fcoras@cisco.com> | 2018-01-15 01:08:33 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-01-25 23:53:35 +0000 |
commit | b384b543313b6b47a277c903e9d4fcd4343054fa (patch) | |
tree | 1996e3a25eb3a32fe5bbc405d75f38dd041a5a40 /src/svm/svm_fifo_segment.h | |
parent | 4e578068fc3fe8ba176d211123ddd88962dab315 (diff) |
session: add support for memfd segments
- update segment manager and session api to work with both flavors of
ssvm segments
- added generic ssvm slave/master init and del functions
- cleanup/refactor tcp_echo
- fixed uses of svm fifo pool as vector
Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo_segment.h')
-rw-r--r-- | src/svm/svm_fifo_segment.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/svm/svm_fifo_segment.h b/src/svm/svm_fifo_segment.h index 405df934578..0e86c25deab 100644 --- a/src/svm/svm_fifo_segment.h +++ b/src/svm/svm_fifo_segment.h @@ -34,11 +34,11 @@ typedef enum #define FIFO_SEGMENT_F_IS_PRIVATE 1 << 0 /* Private segment */ #define FIFO_SEGMENT_F_IS_MAIN_HEAP 1 << 1 /* Segment is main heap */ #define FIFO_SEGMENT_F_IS_PREALLOCATED 1 << 2 /* Segment is preallocated */ +#define FIFO_SEGMENT_F_WILL_DELETE 1 << 3 /* Segment will be removed */ typedef struct { svm_fifo_t *fifos; /**< Linked list of active RX fifos */ - u8 *segment_name; /**< Segment name */ svm_fifo_t **free_fifos; /**< Freelists, by fifo size */ u32 n_active_fifos; /**< Number of active fifos */ u8 flags; /**< Segment flags */ @@ -65,6 +65,7 @@ extern svm_fifo_segment_main_t svm_fifo_segment_main; typedef struct { + ssvm_segment_type_t segment_type; char *segment_name; u32 segment_size; u32 *new_segment_indices; @@ -72,13 +73,15 @@ typedef struct u32 tx_fifo_size; u32 preallocated_fifo_pairs; u32 private_segment_count; + u32 seg_protected_space; + int memfd_fd; } svm_fifo_segment_create_args_t; static inline svm_fifo_segment_private_t * svm_fifo_segment_get_segment (u32 segment_index) { svm_fifo_segment_main_t *ssm = &svm_fifo_segment_main; - return vec_elt_at_index (ssm->segments, segment_index); + return pool_elt_at_index (ssm->segments, segment_index); } static inline u8 @@ -120,9 +123,13 @@ u32 svm_fifo_segment_index (svm_fifo_segment_private_t * s); u32 svm_fifo_segment_num_fifos (svm_fifo_segment_private_t * fifo_segment); u32 svm_fifo_segment_num_free_fifos (svm_fifo_segment_private_t * fifo_segment, u32 fifo_size_in_bytes); +void svm_fifo_segment_info (svm_fifo_segment_private_t * seg, uword * address, + u64 * size); svm_fifo_segment_private_t *svm_fifo_segment_segments_pool (void); + format_function_t format_svm_fifo_segment; +format_function_t format_svm_fifo_segment_type; #endif /* __included_ssvm_fifo_segment_h__ */ |