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",
212 u32 n_left_from, next_index, *from, *to_next;
219 while (n_left_from > 0)
225 while (n_left_from > 0 && n_left_to_next > 0)
268 u32 acl_pos_p0, acl_match_p0;
269 u32 rule_match_p0, trace_bitmap0;
283 &pkt_5tuple0, is_ip6,
284 &action0, &acl_pos_p0,
314 n_left_to_next, bi0, next0);
328 s =
format (s,
" src-epg:%d dst-epg:%d acl-index:%d",
351 .name =
"ip4-gbp-policy-dpo",
352 .vector_size =
sizeof (
u32),
362 .name =
"ip6-gbp-policy-dpo",
363 .vector_size =
sizeof (
u32),
398 u32 n_left_from, *from, *to_next;
405 while (n_left_from > 0)
411 while (n_left_from > 0 && n_left_to_next > 0)
413 u32 bi0, sw_if_index0, fib_index0, lbi0;
477 to_next, n_left_to_next,
517 .name =
"ip4-gbp-lpm-classify",
518 .vector_size =
sizeof (
u32),
533 .name =
"ip6-gbp-lpm-classify",
534 .vector_size =
sizeof (
u32),
549 .arc_name =
"ip4-unicast",
550 .node_name =
"ip4-gbp-lpm-classify",
555 .arc_name =
"ip6-unicast",
556 .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
static acl_plugin_methods_t acl_plugin
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 uword gbp_policy_dpo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip6)
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.
static void acl_plugin_fill_5tuple_inline(void *p_acl_main, u32 lc_index, vlib_buffer_t *b0, int is_ip6, int is_input, int is_l2_path, fa_5tuple_opaque_t *p5tuple_pkt)
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)
u32 gc_lc_index
lookup context and acl index
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.
The value for an Contract.
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)
static u64 gbp_acl_lookup(gbp_contract_key_t *key)
#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)
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.
static int acl_plugin_match_5tuple_inline(void *p_acl_main, u32 lc_index, fa_5tuple_opaque_t *pkt_5tuple, int is_ip6, u8 *r_action, u32 *r_acl_pos_p, u32 *r_acl_match_p, u32 *r_rule_match_p, u32 *trace_bitmap)
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
Group Base Policy (GBP) defines:
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)