68 return (gpd - gbp_policy_dpo_pool);
113 memset (gpd, 0,
sizeof (*gpd));
133 u32 indent = va_arg (*ap,
u32);
137 s =
format (s,
"gbp-policy-dpo: %U, epg:%d out:%U",
162 "ip4-gbp-policy-dpo",
167 "ip6-gbp-policy-dpo",
211 u32 n_left_from, next_index, *from, *to_next;
218 while (n_left_from > 0)
224 while (n_left_from > 0 && n_left_to_next > 0)
227 u32 bi0, next0, acl_index0;
261 if (~0 != acl_index0)
294 n_left_to_next, bi0, next0);
308 s =
format (s,
" src-epg:%d dst-epg:%d acl-index:%d",
331 .name =
"ip4-gbp-policy-dpo",
332 .vector_size =
sizeof (
u32),
342 .name =
"ip6-gbp-policy-dpo",
343 .vector_size =
sizeof (
u32),
378 u32 n_left_from, *from, *to_next;
385 while (n_left_from > 0)
391 while (n_left_from > 0 && n_left_to_next > 0)
393 u32 bi0, sw_if_index0, fib_index0, lbi0;
457 to_next, n_left_to_next,
497 .name =
"ip4-gbp-lpm-classify",
498 .vector_size =
sizeof (
u32),
513 .name =
"ip6-gbp-lpm-classify",
514 .vector_size =
sizeof (
u32),
529 .arc_name =
"ip4-unicast",
530 .node_name =
"ip4-gbp-lpm-classify",
535 .arc_name =
"ip6-unicast",
536 .node_name =
"ip6-gbp-lpm-classify",
dpo_lock_fn_t dv_lock
A reference counting lock function.
A virtual function table regisitered for a DPO type.
vnet_main_t * vnet_get_main(void)
struct gbp_classify_trace_t_ gbp_classify_trace_t
per-packet trace data
vlib_node_registration_t gbp_ip6_lpm_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip6_lpm_classify_node)
static uword ip4_gbp_policy_dpo(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
u32 gr_fib_index[FIB_PROTOCOL_IP_MAX]
FIB indices the EPG is mapped to.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
gbp_policy_dpo_t * gbp_policy_dpo_get(index_t index)
static u32 ip6_fib_table_fwding_lookup(ip6_main_t *im, u32 fib_index, const ip6_address_t *dst)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static gbp_policy_dpo_t * gbp_policy_dpo_get_from_dpo(const dpo_id_t *dpo)
format_function_t format_vnet_sw_if_index_name
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static const char *const gbp_policy_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
static gbp_policy_dpo_t * gbp_policy_dpo_pool
DPO pool.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type() ...
#define VLIB_INIT_FUNCTION(x)
static u8 * format_gbp_policy_dpo_trace(u8 *s, va_list *args)
static gbp_policy_dpo_t * gbp_policy_dpo_alloc(void)
An Endpoint Group representation.
u32 gpd_sw_if_index
output sw_if_index
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
static clib_error_t * gbp_policy_dpo_module_init(vlib_main_t *vm)
dpo_type_t gbp_policy_dpo_get_type(void)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
u8 * format_gbp_policy_dpo(u8 *s, va_list *ap)
static u32 gbp_policy_dpo_get_urpf(const dpo_id_t *dpo)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static gbp_policy_dpo_t * gbp_policy_dpo_get_i(index_t index)
static void gbp_policy_dpo_lock(dpo_id_t *dpo)
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
static const char *const gbp_policy_dpo_ip6_nodes[]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
static uword gbp_policy_dpo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, fib_protocol_t fproto)
static void gbp_policy_dpo_unlock(dpo_id_t *dpo)
static const gbp_recirc_t * gbp_recirc_get(u32 sw_if_index)
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
void dvr_dpo_add_or_lock(u32 sw_if_index, dpo_proto_t dproto, dpo_id_t *dpo)
#define VLIB_REGISTER_NODE(x,...)
void gbp_policy_dpo_add_or_lock(dpo_proto_t dproto, epg_id_t epg, u32 sw_if_index, dpo_id_t *dpo)
static u32 gbp_acl_lookup(gbp_contract_key_t *key)
struct gbp_policy_dpo_trace_t_ gbp_policy_dpo_trace_t
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
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.
epg_id_t gck_src
source and destination EPGs for which the ACL applies
static const char *const *const gbp_policy_dpo_nodes[DPO_PROTO_NUM]
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
VNET_FEATURE_INIT(gbp_ip4_lpm_classify_feat_node, static)
static load_balance_t * load_balance_get(index_t lbi)
u16 gpd_locks
number of locks.
static dpo_type_t gbp_policy_dpo_type
DPO type registered for these GBP FWD.
vlib_node_registration_t ip4_gbp_policy_dpo_node
(constructor) VLIB_REGISTER_NODE (ip4_gbp_policy_dpo_node)
static index_t ip4_fib_forwarding_lookup(u32 fib_index, const ip4_address_t *addr)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
#define VNET_FEATURES(...)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
index_t dpoi_index
the index of objects of that type
enum gbp_lpm_classify_next_t_ gbp_lpm_classify_next_t
static uword gbp_ip6_lpm_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
dpo_id_t gpd_dpo
Stacked DPO on DVR of output interface.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static index_t gbp_policy_dpo_get_index(gbp_policy_dpo_t *gpd)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
VLIB_NODE_FUNCTION_MULTIARCH(gbp_ip4_lpm_classify_node, gbp_ip4_lpm_classify)
dpo_proto_t gpd_proto
The protocol of packets using this DPO.
static uword ip6_gbp_policy_dpo(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
vlib_node_registration_t gbp_ip4_lpm_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip4_lpm_classify_node)
static uword gbp_lpm_classify_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
u16 dpoi_next_node
The next VLIB node to follow.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vlib_node_registration_t ip6_gbp_policy_dpo_node
(constructor) VLIB_REGISTER_NODE (ip6_gbp_policy_dpo_node)
static u8 * format_gbp_classify_trace(u8 *s, va_list *args)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
static uword gbp_ip4_lpm_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)