FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
bier_disp_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __BIER_DISP_TABLE_H__
17 #define __BIER_DISP_TABLE_H__
18 
19 #include <vnet/ip/ip.h>
20 #include <vnet/adj/adj.h>
21 #include <vnet/dpo/replicate_dpo.h>
22 
23 #include <vnet/bier/bier_types.h>
25 
26 /**
27  * @brief
28  * A protocol Independent IP multicast FIB table
29  */
30 typedef struct bier_disp_table_t_
31 {
32  /**
33  * Required for pool_get_aligned
34  */
35  CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
36 
37  /**
38  * number of locks on the table
39  */
41 
42  /**
43  * Table ID (hash key) for this FIB.
44  */
46 
47  /**
48  * The lookup DB based on sender BP. Value is the index of the
49  * BIER disp object.
50  */
53 
54 /**
55  * @brief
56  * Format the description/name of the table
57  */
58 extern u8* format_bier_disp_table(u8* s, va_list *ap);
59 
61  bier_bp_t src,
62  bier_hdr_proto_id_t payload_proto,
63  const fib_route_path_t *rpath);
64 
66  bier_bp_t src,
67  bier_hdr_proto_id_t payload_proto,
68  const fib_route_path_t *paths);
69 
71 
72 
75 
76 extern void bier_disp_table_unlock(index_t bdti);
77 extern void bier_disp_table_lock(index_t bdti);
79  dpo_id_t *dpo);
80 
81 /**
82  * Types and functions to walk all the entries in one BIER Table
83  */
84 typedef void (*bier_disp_table_walk_fn_t)(const bier_disp_table_t *bdt,
85  const bier_disp_entry_t *bde,
86  u16 bp,
87  void *ctx);
90  void *ctx);
91 
92 /**
93  * @brief
94  * Get a pointer to a FIB table
95  */
97 
98 static inline bier_disp_table_t *
100 {
101  return (pool_elt_at_index(bier_disp_table_pool, bdti));
102 }
103 
104 static inline index_t
107 {
108  bier_disp_table_t *bdt;
109 
110  bdt = bier_disp_table_get(bdti);
111 
112  return (bdt->bdt_db[src]);
113 }
114 
115 #endif
adj.h
BIER_BP_MAX
#define BIER_BP_MAX
The maximum BP that can be assigned.
Definition: bier_types.h:301
bier_disp_table_get
static bier_disp_table_t * bier_disp_table_get(index_t bdti)
Definition: bier_disp_table.h:99
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
bier_disp_table_t_::bdt_db
index_t bdt_db[BIER_BP_MAX]
The lookup DB based on sender BP.
Definition: bier_disp_table.h:51
bier_hdr_src_id_t
u16 bier_hdr_src_id_t
An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR.
Definition: bier_types.h:307
bier_disp_entry.h
paths
paths
Definition: map.api:460
u16
unsigned short u16
Definition: types.h:57
bier_disp_table_walk_fn_t
void(* bier_disp_table_walk_fn_t)(const bier_disp_table_t *bdt, const bier_disp_entry_t *bde, u16 bp, void *ctx)
Types and functions to walk all the entries in one BIER Table.
Definition: bier_disp_table.h:84
bier_bp_t
u32 bier_bp_t
A bit positon as assigned to egress PEs.
Definition: bier_types.h:294
replicate_dpo.h
bier_disp_entry_t_
bier_disposition : The BIER disposition object
Definition: bier_disp_entry.h:32
bier_disp_table_t_::bdt_locks
u16 bdt_locks
number of locks on the table
Definition: bier_disp_table.h:40
bier_disp_table_t
struct bier_disp_table_t_ bier_disp_table_t
A protocol Independent IP multicast FIB table.
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
bier_disp_table_add_or_lock
index_t bier_disp_table_add_or_lock(u32 table_id)
Definition: bier_disp_table.c:57
bier_disp_table_find
index_t bier_disp_table_find(u32 table_id)
Definition: bier_disp_table.c:42
src
vl_api_address_t src
Definition: gre.api:54
bier_disp_table_pool
bier_disp_table_t * bier_disp_table_pool
Get a pointer to a FIB table.
Definition: bier_disp_table.c:22
bier_hdr_proto_id_t
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
bier_disp_table_unlock
void bier_disp_table_unlock(index_t bdti)
Definition: bier_disp_table.c:104
format_bier_disp_table
u8 * format_bier_disp_table(u8 *s, va_list *ap)
Format the description/name of the table.
Definition: bier_disp_table.c:143
ip.h
u32
unsigned int u32
Definition: types.h:88
table_id
u32 table_id
Definition: wireguard.api:102
fib_route_path_t_
A representation of a path as described by a route producer.
Definition: fib_types.h:500
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
bier_disp_table_entry_path_remove
void bier_disp_table_entry_path_remove(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *paths)
Definition: bier_disp_table.c:243
bier_types.h
bier_disp_table_t_
A protocol Independent IP multicast FIB table.
Definition: bier_disp_table.h:30
bier_disp_table_walk
void bier_disp_table_walk(u32 table_id, bier_disp_table_walk_fn_t fn, void *ctx)
Definition: bier_disp_table.c:274
bier_disp_table_t_::CLIB_CACHE_LINE_ALIGN_MARK
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
Required for pool_get_aligned.
u8
unsigned char u8
Definition: types.h:56
bier_disp_table_lookup
static index_t bier_disp_table_lookup(index_t bdti, bier_hdr_src_id_t src)
Definition: bier_disp_table.h:105
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
bier_disp_table_contribute_forwarding
void bier_disp_table_contribute_forwarding(index_t bdti, dpo_id_t *dpo)
Definition: bier_disp_table.c:132
bier_disp_table_entry_path_add
void bier_disp_table_entry_path_add(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *rpath)
Definition: bier_disp_table.c:217
bier_disp_table_t_::bdt_table_id
u32 bdt_table_id
Table ID (hash key) for this FIB.
Definition: bier_disp_table.h:45
bier_disp_table_unlock_w_table_id
void bier_disp_table_unlock_w_table_id(u32 table_id)
Definition: bier_disp_table.c:91
bier_disp_table_lock
void bier_disp_table_lock(index_t bdti)
Definition: bier_disp_table.c:126