|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
49 #define INDEX_INVALID ((index_t)(~0))
72 #define DPO_PROTO_NUM ((dpo_proto_t)(DPO_PROTO_NSH+1))
73 #define DPO_PROTO_NONE ((dpo_proto_t)(DPO_PROTO_NUM+1))
75 #define DPO_PROTOS { \
76 [DPO_PROTO_IP4] = "ip4", \
77 [DPO_PROTO_IP6] = "ip6", \
78 [DPO_PROTO_ETHERNET] = "ethernet", \
79 [DPO_PROTO_MPLS] = "mpls", \
80 [DPO_PROTO_NSH] = "nsh", \
81 [DPO_PROTO_BIER] = "bier", \
84 #define FOR_EACH_DPO_PROTO(_proto) \
85 for (_proto = DPO_PROTO_IP4; \
86 _proto <= DPO_PROTO_NSH; \
133 #define DPO_TYPE_NUM DPO_LAST
135 #define DPO_TYPES { \
136 [DPO_FIRST] = "dpo-invalid", \
137 [DPO_DROP] = "dpo-drop", \
138 [DPO_IP_NULL] = "dpo-ip-null", \
139 [DPO_PUNT] = "dpo-punt", \
140 [DPO_ADJACENCY] = "dpo-adjacency", \
141 [DPO_ADJACENCY_INCOMPLETE] = "dpo-adjacency-incomplete", \
142 [DPO_ADJACENCY_MIDCHAIN] = "dpo-adjacency-midcahin", \
143 [DPO_ADJACENCY_GLEAN] = "dpo-glean", \
144 [DPO_ADJACENCY_MCAST] = "dpo-adj-mcast", \
145 [DPO_ADJACENCY_MCAST_MIDCHAIN] = "dpo-adj-mcast-midchain", \
146 [DPO_RECEIVE] = "dpo-receive", \
147 [DPO_LOOKUP] = "dpo-lookup", \
148 [DPO_LOAD_BALANCE] = "dpo-load-balance", \
149 [DPO_REPLICATE] = "dpo-replicate", \
150 [DPO_LISP_CP] = "dpo-lisp-cp", \
151 [DPO_CLASSIFY] = "dpo-classify", \
152 [DPO_MPLS_DISPOSITION_PIPE] = "dpo-mpls-diposition-pipe", \
153 [DPO_MPLS_DISPOSITION_UNIFORM] = "dpo-mpls-diposition-uniform", \
154 [DPO_MFIB_ENTRY] = "dpo-mfib-entry", \
155 [DPO_INTERFACE_RX] = "dpo-interface-rx", \
156 [DPO_INTERFACE_TX] = "dpo-interface-tx", \
157 [DPO_DVR] = "dpo-dvr", \
158 [DPO_L3_PROXY] = "dpo-l3-proxy", \
159 [DPO_BIER_TABLE] = "bier-table", \
160 [DPO_BIER_FMASK] = "bier-fmask", \
161 [DPO_BIER_IMP] = "bier-imposition", \
162 [DPO_BIER_DISP_ENTRY] = "bier-disp-entry", \
163 [DPO_BIER_DISP_TABLE] = "bier-disp-table", \
164 [DPO_IP6_LL] = "ip6-link-local", \
165 [DPO_PW_CW] = "PW-CW", \
197 "DPO ID is greater than sizeof u64 "
198 "atomic updates need to be revisited");
204 #define DPO_INVALID \
206 .dpoi_type = DPO_FIRST, \
207 .dpoi_proto = DPO_PROTO_NONE, \
208 .dpoi_index = INDEX_INVALID, \
209 .dpoi_next_node = 0, \
482 const char *
const *
const * nodes);
499 const char *
const *
const * nodes);
544 #define dpo_pool_barrier_sync(VM,P,YESNO) \
546 pool_get_aligned_will_expand ((P), YESNO, CLIB_CACHE_LINE_BYTES); \
550 VM = vlib_get_main(); \
551 ASSERT ((VM)->thread_index == 0); \
552 vlib_worker_thread_barrier_sync((VM)); \
568 #define dpo_pool_barrier_release(VM,YESNO) \
569 if ((YESNO)) vlib_worker_thread_barrier_release((VM));
u16 dpoi_next_node
The next VLIB node to follow.
struct dpo_vft_t_ dpo_vft_t
A virtual function table regisitered for a DPO type.
STATIC_ASSERT(sizeof(dpo_id_t)<=sizeof(u64), "DPO ID is greater than sizeof u64 " "atomic updates need to be revisited")
index_t dpoi_index
the index of objects of that type
void(* dpo_unlock_fn_t)(dpo_id_t *dpo)
An unlock function registered for a DPO type.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u32 dpo_get_urpf(const dpo_id_t *dpo)
Get a uRPF interface for the DPO.
dpo_type_t dpoi_type
the type
format_function_t * dv_format
A format function.
int dpo_is_adj(const dpo_id_t *dpo)
Return TRUE is the DPO is any type of adjacency.
u16(* dpo_get_mtu_t)(const dpo_id_t *dpo)
Given a DPO instance return the MTU.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
struct dpo_id_t_ dpo_id_t
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
vnet_link_t dpo_proto_to_link(dpo_proto_t dp)
format a DPO protocol
void(* dpo_lock_fn_t)(dpo_id_t *dpo)
A lock function registered for a DPO type.
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent_dpo)
Set and stack a DPO.
dpo_get_next_node_t dv_get_next_node
A function to get the next VLIB node given an instance of the DPO.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
dpo_type_t_
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
void dpo_stack_from_node(u32 child_node, dpo_id_t *dpo, const dpo_id_t *parent)
Set and stack a DPO.
dpo_get_urpf_t dv_get_urpf
Get uRPF interface.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
void dpo_mk_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Make an interpose DPO from an original.
dpo_proto_t_
Data path protocol.
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
void(* dpo_mk_interpose_t)(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Called during FIB interposition when the originally registered DPO is used to 'clone' an instance for...
@ DPO_FIRST
A non-zero value first so we can spot unitialisation errors.
@ DPO_MPLS_DISPOSITION_PIPE
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
dpo_lock_fn_t dv_unlock
A reference counting unlock function.
dpo_lock_fn_t dv_lock
A reference counting lock function.
void dpo_lock(dpo_id_t *dpo)
Take a reference counting lock on the DPO.
dpo_proto_t dpoi_proto
the data-path protocol of the type.
@ DPO_ADJACENCY_MCAST_MIDCHAIN
@ DPO_LOAD_BALANCE
load-balancing over a choice of [un]equal cost paths
dpo_mk_interpose_t dv_mk_interpose
Signal on an interposed child that the parent has changed.
int dpo_cmp(const dpo_id_t *dpo1, const dpo_id_t *dpo2)
compare two DPOs for equality
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
u32 *(* dpo_get_next_node_t)(const dpo_id_t *dpo)
Given a DPO instance return a vector of node indices that the type/instance will use.
dpo_get_mtu_t dv_get_mtu
Get MTU.
void(* dpo_mem_show_t)(void)
An memory usage show command.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
A virtual function table regisitered for a DPO type.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
@ DPO_ADJACENCY_INCOMPLETE
u32(* dpo_get_urpf_t)(const dpo_id_t *dpo)
Given a DPO instance return an interface that can be used in an uRPF check.
u16 dpo_get_mtu(const dpo_id_t *dpo)
Get the MTU DPO.
u32 dpo_get_next_node_by_type_and_proto(dpo_type_t child_type, dpo_proto_t child_proto, dpo_type_t parent_type, dpo_proto_t parent_proto)
Return already stacked up next node index for a given child_type/child_proto and parent_type/patent_p...
@ DPO_MPLS_DISPOSITION_UNIFORM
void dpo_unlock(dpo_id_t *dpo)
Release a reference counting lock on the DPO.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vl_api_fib_path_type_t type
dpo_mem_show_t dv_mem_show
A show memory usage function.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
u8 * format_dpo_type(u8 *s, va_list *args)
format a DPO type