FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
bier_imp.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  * bier_imposition : The BIER imposition object
17  *
18  * A BIER imposition object is present in the IP mcast output list
19  * and represents the imposition of a BIER bitmask. After BIER header
20  * imposition the packet is forward within the appropriate/specifid
21  * BIER table
22  */
23 
24 #ifndef __BIER_IMPOSITION_H__
25 #define __BIER_IMPOSITION_H__
26 
27 #include <vnet/bier/bier_types.h>
28 #include <vnet/fib/fib_types.h>
29 #include <vnet/dpo/dpo.h>
30 
31 /**
32  * The BIER imposition object
33  */
34 typedef struct bier_imp_t_ {
35  /**
36  * Required for pool_get_aligned
37  */
38  CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
39 
40  /**
41  * The DPO contirubted from the resolving BIER table.
42  * One per-IP protocol. This allows us to share a BIER imposition
43  * object for a IPv4 and IPv6 mfib path.
44  */
46 
47  /**
48  * The Header to impose.
49  */
51 
52  /**
53  * The bit string.
54  * This is a memory v. speed tradeoff. We inline here the
55  * largest header type so as the bitstring is on the same
56  * cacheline as the header.
57  */
59 
60  /**
61  * The BIER table into which to forward the post imposed packet
62  */
64 
65  /**
66  * number of locks
67  */
69 
70 } bier_imp_t;
71 
73  bier_bp_t sender,
74  const bier_bit_string_t *bs);
75 
76 extern void bier_imp_unlock(index_t bii);
77 extern void bier_imp_lock(index_t bii);
78 
79 extern u8* format_bier_imp(u8* s, va_list *ap);
80 
82  dpo_proto_t proto,
83  dpo_id_t *dpo);
84 
86 
89 {
90  return (pool_elt_at_index(bier_imp_pool, bii));
91 }
92 
93 #endif
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
Required for pool_get_aligned.
u32 bi_locks
number of locks
Definition: bier_imp.h:68
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
Definition: fib_types.h:58
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:41
bier_imp_t * bier_imp_pool
bier_imposition : The BIER imposition object
Definition: bier_imp.c:33
The ID of a table.
Definition: bier_types.h:394
unsigned char u8
Definition: types.h:56
A Variable length BitString.
Definition: bier_types.h:278
void bier_imp_contribute_forwarding(index_t bii, dpo_proto_t proto, dpo_id_t *dpo)
Definition: bier_imp.c:174
bier_imposition : The BIER imposition object
Definition: bier_imp.h:34
#define always_inline
Definition: clib.h:92
static bier_imp_t * bier_imp_get(index_t bii)
Definition: bier_imp.h:88
bier_hdr_t bi_hdr
The Header to impose.
Definition: bier_imp.h:50
unsigned int u32
Definition: types.h:88
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u32 bier_bp_t
A bit positon as assigned to egress PEs.
Definition: bier_types.h:294
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:168
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:461
struct bier_imp_t_ bier_imp_t
bier_imposition : The BIER imposition object
u8 * format_bier_imp(u8 *s, va_list *ap)
Definition: bier_imp.c:137
void bier_imp_lock(index_t bii)
Definition: bier_imp.c:48
void bier_imp_unlock(index_t bii)
Definition: bier_imp.c:110
u8 bi_bits[BIER_HDR_BUCKETS_1024]
The bit string.
Definition: bier_imp.h:58
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
Definition: bier_types.h:321
bier_table_id_t bi_tbl
The BIER table into which to forward the post imposed packet.
Definition: bier_imp.h:63
dpo_id_t bi_dpo[FIB_PROTOCOL_IP_MAX]
The DPO contirubted from the resolving BIER table.
Definition: bier_imp.h:45
index_t bier_imp_add_or_lock(const bier_table_id_t *bt, bier_bp_t sender, const bier_bit_string_t *bs)
Definition: bier_imp.c:60