FD.io VPP  v16.06
Vector Packet Processing
fifo.h File Reference
+ Include dependency graph for fifo.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  clib_fifo_header_t
 

Macros

#define clib_fifo_len(v)   vec_len(v)
 
#define clib_fifo_end(v)   vec_end(v)
 
#define clib_fifo_resize(f, n_elts)   f = _clib_fifo_resize ((f), (n_elts), sizeof ((f)[0]))
 
#define clib_fifo_validate(f, n_elts)   f = _clib_fifo_validate ((f), (n_elts), sizeof (f[0]))
 
#define clib_fifo_advance_tail(f, n_elts)
 
#define clib_fifo_add1(f, e)
 
#define clib_fifo_add2(f, p)
 
#define clib_fifo_add(f, e, n)
 
#define clib_fifo_sub1(f, e)
 
#define clib_fifo_sub2(f, p)
 
#define clib_fifo_head(v)   ((v) + clib_fifo_head_index (v))
 
#define clib_fifo_tail(v)   ((v) + clib_fifo_tail_index (v))
 
#define clib_fifo_free(f)   vec_free_h((f),sizeof(clib_fifo_header_t))
 
#define clib_fifo_elt_at_index(v, i)   ((v) + clib_fifo_elt_index (v, (i)))
 
#define clib_fifo_foreach(v, f, body)
 

Functions

always_inline clib_fifo_header_tclib_fifo_header (void *f)
 
always_inline uword clib_fifo_elts (void *v)
 
always_inline uword clib_fifo_free_elts (void *v)
 
always_inline void clib_fifo_reset (void *v)
 
always_inline uword clib_fifo_advance_head (void *v, uword n_elts)
 
always_inline uword clib_fifo_head_index (void *v)
 
always_inline uword clib_fifo_tail_index (void *v)
 
always_inline uword clib_fifo_elt_index (void *v, uword i)
 

Macro Definition Documentation

#define clib_fifo_add (   f,
  e,
 
)
Value:
do { \
uword _i, _l; word _n0, _n1; \
\
_n0 = (n); \
(f) = _clib_fifo_advance_tail ((f), _n0, sizeof ((f)[0]), &_i); \
_l = clib_fifo_len (f); \
_n1 = _i + _n0 - _l; \
_n1 = _n1 < 0 ? 0 : _n1; \
_n0 -= _n1; \
clib_memcpy ((f) + _i, (e), _n0 * sizeof ((f)[0])); \
if (_n1) \
clib_memcpy ((f) + 0, (e) + _n0, _n1 * sizeof ((f)[0])); \
} while (0)
#define clib_memcpy(a, b, c)
Definition: string.h:63
u64 uword
Definition: types.h:112
i64 word
Definition: types.h:111
#define clib_fifo_len(v)
Definition: fifo.h:58

Definition at line 203 of file fifo.h.

#define clib_fifo_add1 (   f,
 
)
Value:
do { \
uword _i; \
(f) = _clib_fifo_advance_tail ((f), 1, sizeof ((f)[0]), &_i); \
(f)[_i] = (e); \
} while (0)
u64 uword
Definition: types.h:112

Definition at line 187 of file fifo.h.

#define clib_fifo_add2 (   f,
 
)
Value:
do { \
uword _i; \
(f) = _clib_fifo_advance_tail ((f), 1, sizeof ((f)[0]), &_i); \
(p) = (f) + _i; \
} while (0)
u64 uword
Definition: types.h:112

Definition at line 195 of file fifo.h.

#define clib_fifo_advance_tail (   f,
  n_elts 
)
Value:
({ \
uword _i; \
(f) = _clib_fifo_advance_tail ((f), (n_elts), sizeof ((f)[0]), &_i); \
(f) + _i; \
})
u64 uword
Definition: types.h:112

Definition at line 156 of file fifo.h.

#define clib_fifo_elt_at_index (   v,
  i 
)    ((v) + clib_fifo_elt_index (v, (i)))

Definition at line 272 of file fifo.h.

#define clib_fifo_end (   v)    vec_end(v)

Definition at line 60 of file fifo.h.

#define clib_fifo_foreach (   v,
  f,
  body 
)
Value:
do { \
uword _i, _l, _n; \
\
_l = clib_fifo_len (f); \
_n = clib_fifo_elts (f); \
while (_n > 0) \
{ \
(v) = (f) + _i; \
do { body; } while (0); \
_n--; \
_i++; \
_i = _i >= _l ? 0 : _i; \
} \
} while (0)
always_inline uword clib_fifo_elts(void *v)
Definition: fifo.h:63
always_inline uword clib_fifo_head_index(void *v)
Definition: fifo.h:236
u64 uword
Definition: types.h:112
#define clib_fifo_len(v)
Definition: fifo.h:58

Definition at line 274 of file fifo.h.

#define clib_fifo_free (   f)    vec_free_h((f),sizeof(clib_fifo_header_t))

Definition at line 252 of file fifo.h.

#define clib_fifo_head (   v)    ((v) + clib_fifo_head_index (v))

Definition at line 249 of file fifo.h.

#define clib_fifo_len (   v)    vec_len(v)

Definition at line 58 of file fifo.h.

#define clib_fifo_resize (   f,
  n_elts 
)    f = _clib_fifo_resize ((f), (n_elts), sizeof ((f)[0]))

Definition at line 96 of file fifo.h.

#define clib_fifo_sub1 (   f,
 
)
Value:
do { \
uword _i; \
ASSERT (clib_fifo_elts (f) >= 1); \
_i = clib_fifo_advance_head ((f), 1); \
(e) = (f)[_i]; \
} while (0)
always_inline uword clib_fifo_elts(void *v)
Definition: fifo.h:63
#define ASSERT(truth)
u64 uword
Definition: types.h:112
always_inline uword clib_fifo_advance_head(void *v, uword n_elts)
Definition: fifo.h:164

Definition at line 219 of file fifo.h.

#define clib_fifo_sub2 (   f,
 
)
Value:
do { \
uword _i; \
ASSERT (clib_fifo_elts (f) >= 1); \
_i = clib_fifo_advance_head ((f), 1); \
(p) = (f) + _i; \
} while (0)
always_inline uword clib_fifo_elts(void *v)
Definition: fifo.h:63
#define ASSERT(truth)
u64 uword
Definition: types.h:112
always_inline uword clib_fifo_advance_head(void *v, uword n_elts)
Definition: fifo.h:164

Definition at line 227 of file fifo.h.

#define clib_fifo_tail (   v)    ((v) + clib_fifo_tail_index (v))

Definition at line 250 of file fifo.h.

#define clib_fifo_validate (   f,
  n_elts 
)    f = _clib_fifo_validate ((f), (n_elts), sizeof (f[0]))

Definition at line 107 of file fifo.h.

Function Documentation

always_inline uword clib_fifo_advance_head ( void v,
uword  n_elts 
)

Definition at line 164 of file fifo.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_fifo_elt_index ( void v,
uword  i 
)

Definition at line 255 of file fifo.h.

+ Here is the call graph for this function:

always_inline uword clib_fifo_elts ( void v)

Definition at line 63 of file fifo.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_fifo_free_elts ( void v)

Definition at line 79 of file fifo.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_fifo_head_index ( void v)

Definition at line 236 of file fifo.h.

+ Here is the call graph for this function:

always_inline clib_fifo_header_t* clib_fifo_header ( void f)

Definition at line 54 of file fifo.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void clib_fifo_reset ( void v)

Definition at line 83 of file fifo.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_fifo_tail_index ( void v)

Definition at line 243 of file fifo.h.

+ Here is the call graph for this function: