summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-04-19 13:00:05 -0700
committerDave Barach <openvpp@barachs.net>2017-04-24 12:02:14 +0000
commita5464817522c7a7dc760af4612f1d6a68ed0afc8 (patch)
treec173b6d4e0fac69394d3c1b61a842dc582b2a218 /src/svm/svm_fifo.h
parentbc66a9122f73b97ca1ae60f1df47b39c141be3ae (diff)
Session layer improvements
Among others: - Moved app event queue to shared memory segment - Use private memory segment for builtin apps - Remove pid from svm fifo - Protect session fifo (de)allocation - Use fifo event for session disconnects - Have session queue node poll in all wk threads Change-Id: I89dbf7fdfebef12f5ef2b34ba3ef3c2c07f49ff2 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 0fff2577517..d67237c69b0 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -23,13 +23,6 @@
#include <vppinfra/format.h>
#include <pthread.h>
-typedef enum
-{
- SVM_FIFO_TAG_NOT_HELD = 0,
- SVM_FIFO_TAG_DEQUEUE,
- SVM_FIFO_TAG_ENQUEUE,
-} svm_lock_tag_t;
-
/** Out-of-order segment */
typedef struct
{
@@ -37,7 +30,7 @@ typedef struct
u32 prev; /**< Previous linked-list element pool index */
u32 start; /**< Start of segment, normalized*/
- u32 length; /**< Length of segment */
+ u32 length; /**< Length of segment */
} ooo_segment_t;
format_function_t format_ooo_segment;
@@ -52,12 +45,11 @@ typedef struct
CLIB_CACHE_LINE_ALIGN_MARK (end_cursize);
volatile u8 has_event; /**< non-zero if deq event exists */
- u32 owner_pid;
/* Backpointers */
- u32 server_session_index;
+ u32 master_session_index;
u32 client_session_index;
- u8 server_thread_index;
+ u8 master_thread_index;
u8 client_thread_index;
u32 segment_manager;
CLIB_CACHE_LINE_ALIGN_MARK (end_shared);
@@ -117,19 +109,14 @@ svm_fifo_unset_event (svm_fifo_t * f)
svm_fifo_t *svm_fifo_create (u32 data_size_in_bytes);
void svm_fifo_free (svm_fifo_t * f);
-int svm_fifo_enqueue_nowait (svm_fifo_t * f, int pid, u32 max_bytes,
+int svm_fifo_enqueue_nowait (svm_fifo_t * f, u32 max_bytes,
u8 * copy_from_here);
+int svm_fifo_enqueue_with_offset (svm_fifo_t * f, u32 offset,
+ u32 required_bytes, u8 * copy_from_here);
+int svm_fifo_dequeue_nowait (svm_fifo_t * f, u32 max_bytes, u8 * copy_here);
-int svm_fifo_enqueue_with_offset (svm_fifo_t * f, int pid,
- u32 offset, u32 required_bytes,
- u8 * copy_from_here);
-
-int svm_fifo_dequeue_nowait (svm_fifo_t * f, int pid, u32 max_bytes,
- u8 * copy_here);
-
-int svm_fifo_peek (svm_fifo_t * f, int pid, u32 offset, u32 max_bytes,
- u8 * copy_here);
-int svm_fifo_dequeue_drop (svm_fifo_t * f, int pid, u32 max_bytes);
+int svm_fifo_peek (svm_fifo_t * f, u32 offset, u32 max_bytes, u8 * copy_here);
+int svm_fifo_dequeue_drop (svm_fifo_t * f, u32 max_bytes);
u32 svm_fifo_number_ooo_segments (svm_fifo_t * f);
ooo_segment_t *svm_fifo_first_ooo_segment (svm_fifo_t * f);