FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
sparse_vec.h File Reference
+ Include dependency graph for sparse_vec.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sparse_vec_header_t
 

Macros

#define SPARSE_VEC_IS_RANGE   (1 << 0)
 
#define SPARSE_VEC_IS_VALID_RANGE   (1 << 1)
 
#define SPARSE_VEC_INVALID_INDEX   (0)
 
#define sparse_vec_free(v)   vec_free(v)
 
#define sparse_vec_elt_at_index(v, i)   vec_elt_at_index ((v), sparse_vec_index ((v), (i)))
 
#define sparse_vec_validate(v, i)
 

Functions

static sparse_vec_header_tsparse_vec_header (void *v)
 
static void * sparse_vec_new (uword elt_bytes, uword sparse_index_bits)
 
static uword sparse_vec_index_internal (void *v, uword sparse_index, uword maybe_range, u32 *insert)
 
static uword sparse_vec_index (void *v, uword sparse_index)
 
static void sparse_vec_index2 (void *v, u32 si0, u32 si1, u32 *i0_return, u32 *i1_return)
 

Macro Definition Documentation

#define sparse_vec_elt_at_index (   v,
  i 
)    vec_elt_at_index ((v), sparse_vec_index ((v), (i)))

Definition at line 211 of file sparse_vec.h.

#define sparse_vec_free (   v)    vec_free(v)

Definition at line 209 of file sparse_vec.h.

#define SPARSE_VEC_INVALID_INDEX   (0)

Definition at line 68 of file sparse_vec.h.

#define SPARSE_VEC_IS_RANGE   (1 << 0)

Definition at line 54 of file sparse_vec.h.

#define SPARSE_VEC_IS_VALID_RANGE   (1 << 1)

Definition at line 55 of file sparse_vec.h.

#define sparse_vec_validate (   v,
  i 
)
Value:
({ \
uword _i; \
u32 _insert; \
\
if (! (v)) \
(v) = sparse_vec_new (sizeof ((v)[0]), BITS (u16)); \
\
/* maybe range */ 0, \
/* insert? */ &_insert); \
if (_insert) \
vec_insert_ha ((v), 1, _i, \
/* header size */ sizeof (sparse_vec_header_t), \
/* align */ 0); \
\
/* Invalid index is 0. */ \
ASSERT (_i > 0); \
\
(v) + _i; \
})
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:343
#define v
Definition: acl.c:314
#define vec_insert_ha(V, N, M, H, A)
Insert N vector elements starting at element M, initialize new elements to zero (general version) ...
Definition: vec.h:636
#define ASSERT(truth)
unsigned int u32
Definition: types.h:88
u64 uword
Definition: types.h:112
static uword sparse_vec_index_internal(void *v, uword sparse_index, uword maybe_range, u32 *insert)
Definition: sparse_vec.h:101
unsigned short u16
Definition: types.h:57
static void * sparse_vec_new(uword elt_bytes, uword sparse_index_bits)
Definition: sparse_vec.h:71
#define BITS(x)
Definition: clib.h:58

Definition at line 214 of file sparse_vec.h.

Function Documentation

static sparse_vec_header_t* sparse_vec_header ( void *  v)
inlinestatic

Definition at line 60 of file sparse_vec.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword sparse_vec_index ( void *  v,
uword  sparse_index 
)
inlinestatic

Definition at line 152 of file sparse_vec.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void sparse_vec_index2 ( void *  v,
u32  si0,
u32  si1,
u32 i0_return,
u32 i1_return 
)
inlinestatic

Definition at line 160 of file sparse_vec.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword sparse_vec_index_internal ( void *  v,
uword  sparse_index,
uword  maybe_range,
u32 insert 
)
inlinestatic

Definition at line 101 of file sparse_vec.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* sparse_vec_new ( uword  elt_bytes,
uword  sparse_index_bits 
)
inlinestatic

Definition at line 71 of file sparse_vec.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: