/** VCL configuration */
vppcom_cfg_t cfg;
- /** Flag indicating that a new segment is being mounted */
- volatile u32 mounting_segment;
-
volatile u32 forking;
/** Workers */
/** 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;
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)
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)
{