47 #define LISP_ADJ_SET_KEY(_key, _itf, _nh) \ 49 _key.key[0] = (_nh)->ip.v6.as_u64[0]; \ 50 _key.key[1] = (_nh)->ip.v6.as_u64[1]; \ 51 _key.key[2] = (_itf); \ 56 BVT (clib_bihash_kv) kv;
60 if (BV (clib_bihash_search) (&
lisp_adj_db, &kv, &kv) < 0)
73 BVT (clib_bihash_kv) kv;
84 BVT (clib_bihash_kv) kv;
118 memset (b, 0,
sizeof (*b));
225 #define is_v4_packet(_h) ((*(u8*) _h) & 0xF0) == 0x40 296 memset (&key, 0,
sizeof (key));
315 if (lcm->
flags & LISP_FLAG_STATS_ENABLED)
374 u32 overlay_table_id,
u32 vni)
398 memset (ladj, 0,
sizeof (*ladj));
409 ladj->
flags = LISP_GPE_FLAGS_I;
412 ladj->
flags |= LISP_GPE_FLAGS_P;
489 if (0 == ladj->
locks)
548 format (s,
"index %d locks:%d\n", ladj - lisp_adj_pool, ladj->
locks);
554 if (flags & LISP_GPE_ADJ_FORMAT_FLAG_DETAIL)
565 s =
format (s,
" LISP L3 sub-interface index: %d,",
596 ladj - lisp_adj_pool,
609 .path =
"show gpe adjacency",
614 #define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS (256) 615 #define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE (1<<20) 621 "Adjacency Neighbour table",
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
static lisp_gpe_adjacency_t * lisp_gpe_adjacency_get_i(index_t lai)
void adj_nbr_walk_nh(u32 sw_if_index, fib_protocol_t adj_nh_proto, const ip46_address_t *nh, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given next-hop.
Contribute an object that is to be used to forward IP6 packets.
enum lisp_gpe_adjacency_format_flags_t_ lisp_gpe_adjacency_format_flags_t
Flags for displaying the adjacency.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE
void lisp_gpe_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
The LISP-GPE interface registered function to update, i.e.
u32 locks
The number of locks/reference counts on the adjacency.
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
const u8 * adj_get_rewrite(adj_index_t ai)
Return the rewrite string of the adjacency.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
void fib_entry_contribute_forwarding(fib_node_index_t fib_entry_index, fib_forward_chain_type_t fct, dpo_id_t *dpo)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
static clib_error_t * lisp_gpe_adj_module_init(vlib_main_t *vm)
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
static void lisp_gpe_adjacency_last_lock_gone(lisp_gpe_adjacency_t *ladj)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
struct ip_adjacency_t_::@43::@44 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
u8 * format_lisp_gpe_tunnel(u8 *s, va_list *args)
Format LISP-GPE tunnel.
lisp_gpe_fwd_entry_key_t * key
The Entry's key: {lEID,rEID,vni}.
Contribute an object that is to be used to forward IP4 packets.
static index_t lisp_adj_find(const ip_address_t *addr, u32 sw_if_index)
#define STRUCT_OFFSET_OF(t, f)
static fib_node_t * lisp_gpe_adjacency_get_fib_node(fib_node_index_t index)
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
u8 * format_lisp_gpe_sub_interface(u8 *s, va_list *ap)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static fib_node_back_walk_rc_t lisp_gpe_adjacency_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
LISP GPE tunnel back walk.
static clib_error_t * lisp_gpe_adjacency_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
union ip_adjacency_t_::@43 sub_type
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
vnet_link_t ia_link
link/ether-type 1 bytes
static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type(vnet_link_t linkt)
u32 fib_entry_child_index
This adjacency is a child of the FIB entry to reach the RLOC.
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
fib_node_index_t fib_entry_index
the FIB entry through which the remote rloc is reachable s
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
#define VLIB_INIT_FUNCTION(x)
fib_node_t fib_node
The LISP adj is a part of the FIB control plane graph.
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
vlib_combined_counter_main_t counters
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
static void lisp_gpe_adj_stack(lisp_gpe_adjacency_t *ladj)
void lisp_gpe_tunnel_unlock(index_t lgti)
void lisp_gpe_adjacency_unlock(index_t lai)
u32 * fwd_entry_by_mapping_index
static void lisp_gpe_increment_stats_counters(lisp_cp_main_t *lcm, ip_adjacency_t *adj, vlib_buffer_t *b)
const lisp_gpe_sub_interface_t * lisp_gpe_sub_interface_get(index_t l3si)
u32 sw_if_index
The SW if index assigned to this sub-interface.
u8 * lisp_gpe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
#define ip_addr_version(_a)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
static void ip46_address_to_ip_address(const ip46_address_t *a, ip_address_t *b)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
u16 current_length
Nbytes between current data and the end of this buffer.
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
load-balancing over a choice of [un]equal cost paths
static lisp_adj_db
Hash table of all adjacencies.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
#define pool_put(P, E)
Free an object E in pool P.
u32 sw_if_index
The SW IF index of the sub-interface this adjacency uses.
u8 * format_gid_address(u8 *s, va_list *args)
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS
An node in the FIB graph.
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
static void lisp_gpe_adjacency_last_fib_lock_gone(fib_node_t *node)
void ip_address_to_46(const ip_address_t *addr, ip46_address_t *a, fib_protocol_t *proto)
#define ip46_address_is_ip4(ip46)
index_t lisp_gpe_adjacency_find_or_create_and_lock(const locator_pair_t *pair, u32 overlay_table_id, u32 vni)
static void ip_udp_fixup_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 is_ip4)
static_always_inline uword vlib_get_thread_index(void)
#define LISP_ADJ_SET_KEY(_key, _itf, _nh)
#define clib_warning(format, args...)
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
Packets TX through the midchain do not increment the interface counters.
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
void lisp_gpe_sub_interface_unlock(index_t l3si)
Context passed between object during a back walk.
#define VLIB_CLI_COMMAND(x,...)
struct _gid_address_t gid_address_t
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
u8 * format_ip_address(u8 *s, va_list *args)
static lisp_afi_e lisp_afi_from_vnet_link_type(vnet_link_t link)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
static load_balance_t * load_balance_get(index_t lbi)
gid_dictionary_t mapping_index_by_gid
u32 gid_dictionary_sd_lookup(gid_dictionary_t *db, gid_address_t *dst, gid_address_t *src)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
static adj_walk_rc_t lisp_gpe_adj_walk_cb(adj_index_t ai, void *ctx)
Call back when restacking all adjacencies on a GRE interface.
dpo_id_t choice
The DPO used for forwarding.
index_t lisp_gpe_sub_interface_find_or_create_and_lock(const ip_address_t *lrloc, u32 overlay_table_id, u32 vni)
index_t dpoi_index
the index of objects of that type
u32 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static void lisp_gpe_fixup(vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
u8 * lisp_gpe_tunnel_build_rewrite(const lisp_gpe_tunnel_t *lgt, const lisp_gpe_adjacency_t *ladj, lisp_gpe_next_protocol_e payload_proto)
Compute IP-UDP-GPE sub-tunnel encap/rewrite header.
fib_forward_chain_type_t lisp_gpe_adj_get_fib_chain_type(const lisp_gpe_adjacency_t *ladj)
#define hash_get_mem(h, key)
static void lisp_adj_remove(const ip_address_t *addr, u32 sw_if_index)
A FIB graph nodes virtual function table.
u8 * format_lisp_gpe_adjacency(u8 *s, va_list *args)
static lisp_gpe_adjacency_t * lisp_adj_pool
Memory pool of all adjacencies.
void get_src_and_dst_eids_from_buffer(lisp_cp_main_t *lcm, vlib_buffer_t *b, gid_address_t *src, gid_address_t *dst, u16 type)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
static lisp_gpe_adjacency_t * lisp_gpe_adjacency_from_fib_node(const fib_node_t *node)
Get a pointer to a tunnel from a pointer to a FIB node.
u32 lisp_l3_sub_index
The index of the LISP L3 subinterface.
uword * lisp_stats_index_by_key
fib_node_t node
This object joins the FIB control plane graph to receive updates to for changes to the graph...
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 flags
LISP header fields in HOST byte order.
ip_address_t remote_rloc
remote RLOC.
static void lisp_adj_insert(const ip_address_t *addr, u32 sw_if_index, index_t ai)
static void lisp_gpe_adj_stack_one(lisp_gpe_adjacency_t *ladj, adj_index_t ai)
Stack the tunnel's midchain on the IP forwarding chain of the via.
static uword pool_elts(void *v)
Number of active elements in a pool.