summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-08-16 19:55:49 -0700
committerDave Wallace <dwallacelf@gmail.com>2017-08-29 18:53:11 +0000
commitc87c91d8b0e85997debaf575f2e30cc2702edf25 (patch)
tree49ac104b68b3212559bf00e3744a842072631264 /src/vnet/session/segment_manager.h
parent78d5abea8584041b872def163c39464087eed9ef (diff)
session: segment manager improvements
- cleanup connects segment manager even if first - fix segment manager allocation for listen sessions - improve handling of process private segments (mheaps/main heap) - added segment manager cli Change-Id: Ic2ca97c3622ab2286d5fb5772aeb57680e64f769 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vnet/session/segment_manager.h')
-rw-r--r--src/vnet/session/segment_manager.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/vnet/session/segment_manager.h b/src/vnet/session/segment_manager.h
index 41abeb22947..6e5b8989891 100644
--- a/src/vnet/session/segment_manager.h
+++ b/src/vnet/session/segment_manager.h
@@ -55,24 +55,26 @@ typedef struct _segment_manager
/** Owner app index */
u32 app_index;
- /** Pointer to manager properties. Could be shared among all of
- * an app's segment managers s*/
+ /**
+ * Pointer to manager properties. Could be shared among all of
+ * an app's segment managers s
+ */
segment_manager_properties_t *properties;
+
+ /**
+ * First segment should not be deleted unless segment manger is deleted.
+ * This also indicates that the segment manager is the first to have been
+ * allocated for the app.
+ */
+ u8 first_is_protected;
} segment_manager_t;
+#define SEGMENT_MANAGER_INVALID_APP_INDEX ((u32) ~0)
+
/** Pool of segment managers */
extern segment_manager_t *segment_managers;
always_inline segment_manager_t *
-segment_manager_new ()
-{
- segment_manager_t *sm;
- pool_get (segment_managers, sm);
- memset (sm, 0, sizeof (*sm));
- return sm;
-}
-
-always_inline segment_manager_t *
segment_manager_get (u32 index)
{
return pool_elt_at_index (segment_managers, index);
@@ -92,6 +94,7 @@ segment_manager_index (segment_manager_t * sm)
return sm - segment_managers;
}
+segment_manager_t *segment_manager_new ();
int
segment_manager_init (segment_manager_t * sm,
segment_manager_properties_t * properties,
@@ -100,9 +103,11 @@ segment_manager_init (segment_manager_t * sm,
void segment_manager_get_segment_info (u32 index, u8 ** name, u32 * size);
int
session_manager_add_first_segment (segment_manager_t * sm, u32 segment_size);
-void segment_manager_first_segment_maybe_del (segment_manager_t * sm);
int session_manager_add_segment (segment_manager_t * sm);
+void segment_manager_del_sessions (segment_manager_t * sm);
void segment_manager_del (segment_manager_t * sm);
+void segment_manager_init_del (segment_manager_t * sm);
+u8 segment_manager_has_fifos (segment_manager_t * sm);
int
segment_manager_alloc_session_fifos (segment_manager_t * sm,
svm_fifo_t ** server_rx_fifo,