24 u32 rx_fifo_size, tx_fifo_size;
26 u8 *rx_fifo_space, *tx_fifo_space;
49 if (rx_fifo_space == 0 || tx_fifo_space == 0)
54 clib_warning (
"rx fifo preallocation failure: size %d npairs %d",
60 clib_warning (
"tx fifo preallocation failure: size %d nfifos %d",
98 memset (s, 0,
sizeof (*s));
110 _vec_len (s) =
vec_len (s) - 1;
122 memset (fsh, 0,
sizeof (*fsh));
147 memset (s, 0,
sizeof (*s));
159 memset (sh, 0,
sizeof (*sh));
164 memset (fsh, 0,
sizeof (*fsh));
188 memset (s, 0,
sizeof (*s));
199 _vec_len (s) =
vec_len (s) - 1;
222 u32 data_size_in_bytes,
245 memset (f, 0,
sizeof (*f));
246 f->nitems = data_size_in_bytes;
277 fsh->
fifos->prev = f;
278 f->next = fsh->
fifos;
307 f->prev->next = f->next;
309 fsh->
fifos = f->next;
311 f->next->prev = f->prev;
343 return s - svm_fifo_segment_main.
segments;
sll srl srl sll sra u16x4 i
static void * clib_mem_alloc_aligned_at_offset(uword size, uword align, uword align_offset, int os_out_of_memory_on_failure)
int ssvm_master_init(ssvm_private_t *ssvm, u32 master_index)
svm_fifo_segment_freelist_t
ssvm_shared_header_t * sh
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
void ssvm_delete(ssvm_private_t *ssvm)
svm_fifo_segment_main_t svm_fifo_segment_main
struct _svm_fifo svm_fifo_t
static void * ssvm_push_heap(ssvm_shared_header_t *sh)
static void ssvm_pop_heap(void *oldheap)
int svm_fifo_segment_create_process_private(svm_fifo_segment_create_args_t *a)
Create an svm fifo segment in process-private memory.
static void ssvm_unlock(ssvm_shared_header_t *h)
#define pool_put(P, E)
Free an object E in pool P.
int ssvm_slave_init(ssvm_private_t *ssvm, int timeout_in_seconds)
void svm_fifo_segment_init(u64 baseva, u32 timeout_in_seconds)
svm_fifo_segment_header_t * h
u32 svm_fifo_segment_index(svm_fifo_segment_private_t *s)
#define clib_warning(format, args...)
#define OOO_SEGMENT_INVALID_INDEX
static void * clib_mem_get_heap(void)
static void clib_mem_free(void *p)
static void * clib_mem_alloc(uword size)
void svm_fifo_segment_free_fifo(svm_fifo_segment_private_t *s, svm_fifo_t *f, svm_fifo_segment_freelist_t list_index)
int svm_fifo_segment_create(svm_fifo_segment_create_args_t *a)
(master) create an svm fifo segment
svm_fifo_segment_private_t * segments
pool of segments
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void preallocate_fifo_pairs(svm_fifo_segment_header_t *fsh, svm_fifo_segment_create_args_t *a)
u32 preallocated_fifo_pairs
static void * clib_mem_alloc_aligned(uword size, uword align)
#define CLIB_CACHE_LINE_BYTES
int svm_fifo_segment_attach(svm_fifo_segment_create_args_t *a)
(slave) attach to an svm fifo segment
static void ssvm_lock(ssvm_shared_header_t *h, u32 my_pid, u32 tag)
void svm_fifo_segment_delete(svm_fifo_segment_private_t *s)
svm_fifo_t * svm_fifo_segment_alloc_fifo(svm_fifo_segment_private_t *s, u32 data_size_in_bytes, svm_fifo_segment_freelist_t list_index)
svm_fifo_t * svm_fifo_create(u32 data_size_in_bytes)
create an svm fifo, in the current heap.