aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_private.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-29 17:02:29 -0800
committerOle Trøan <otroan@employees.org>2018-11-30 09:33:30 +0000
commitd85de68ec3f72888099172fffd45a90a43018155 (patch)
treebc09880ec51bdccfbe4abd47b258598df9a4854e /src/vcl/vcl_private.h
parente4f849c137101871b1caa0d959c7ea794e7d77f7 (diff)
vcl: wait for segments with segment handle
Instead of waiting for notification from binary api. Change-Id: I5ecab857d6bcdbed62d6bb06709570c4cf6b19ea Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_private.h')
-rw-r--r--src/vcl/vcl_private.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 0420322d3f4..6ca0471e965 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -309,9 +309,6 @@ typedef struct vppcom_main_t_
/** VCL configuration */
vppcom_cfg_t cfg;
- /** Flag indicating that a new segment is being mounted */
- volatile u32 mounting_segment;
-
volatile u32 forking;
/** Workers */
@@ -320,7 +317,15 @@ typedef struct vppcom_main_t_
/** Lock to protect worker registrations */
clib_spinlock_t workers_lock;
+ /** Pool of shared sessions */
vcl_shared_session_t *shared_sessions;
+
+ /** Lock to protect segment hash table */
+ clib_rwlock_t segment_table_lock;
+
+ /** Mapped segments table */
+ uword *segment_table;
+
#ifdef VCL_ELOG
/* VPP Event-logger */
elog_main_t elog_main;
@@ -335,6 +340,8 @@ typedef struct vppcom_main_t_
extern vppcom_main_t *vcm;
#define VCL_INVALID_SESSION_INDEX ((u32)~0)
+#define VCL_INVALID_SEGMENT_INDEX ((u32)~0)
+#define VCL_INVALID_SEGMENT_HANDLE ((u64)~0)
static inline vcl_session_t *
vcl_session_alloc (vcl_worker_t * wrk)
@@ -502,6 +509,10 @@ void vcl_worker_share_sessions (u32 parent_wrk_index);
int vcl_worker_unshare_session (vcl_worker_t * wrk, vcl_session_t * s);
int vcl_session_get_refcnt (vcl_session_t * s);
+void vcl_segment_table_add (u64 segment_handle, u32 svm_segment_index);
+u32 vcl_segment_table_lookup (u64 segment_handle);
+void vcl_segment_table_del (u64 segment_handle);
+
static inline vcl_worker_t *
vcl_worker_get (u32 wrk_index)
{