DPDK  21.02.0
rte_fib6.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>
3  * Copyright(c) 2019 Intel Corporation
4  */
5 
6 #ifndef _RTE_FIB6_H_
7 #define _RTE_FIB6_H_
8 
22 #include <stdint.h>
23 
24 #include <rte_compat.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #define RTE_FIB6_IPV6_ADDR_SIZE 16
31 
32 #define RTE_FIB6_MAXDEPTH 128
33 
34 struct rte_fib6;
35 struct rte_rib6;
36 
41 };
42 
44 typedef int (*rte_fib6_modify_fn_t)(struct rte_fib6 *fib,
45  const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth,
46  uint64_t next_hop, int op);
48 typedef void (*rte_fib6_lookup_fn_t)(void *fib,
49  uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
50  uint64_t *next_hops, const unsigned int n);
51 
52 enum rte_fib6_op {
53  RTE_FIB6_ADD,
54  RTE_FIB6_DEL,
55 };
56 
59  RTE_FIB6_TRIE_2B = 1,
60  RTE_FIB6_TRIE_4B,
61  RTE_FIB6_TRIE_8B
62 };
63 
70 };
71 
73 struct rte_fib6_conf {
76  uint64_t default_nh;
77  int max_routes;
78  union {
79  struct {
80  enum rte_fib_trie_nh_sz nh_sz;
81  uint32_t num_tbl8;
82  } trie;
83  };
84 };
85 
99 __rte_experimental
100 struct rte_fib6 *
101 rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
102 
113 __rte_experimental
114 struct rte_fib6 *
115 rte_fib6_find_existing(const char *name);
116 
125 __rte_experimental
126 void
127 rte_fib6_free(struct rte_fib6 *fib);
128 
143 __rte_experimental
144 int
145 rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],
146  uint8_t depth, uint64_t next_hop);
147 
160 __rte_experimental
161 int
162 rte_fib6_delete(struct rte_fib6 *fib,
163  const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth);
164 
182 __rte_experimental
183 int
184 rte_fib6_lookup_bulk(struct rte_fib6 *fib,
185  uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
186  uint64_t *next_hops, int n);
187 
197 __rte_experimental
198 void *
199 rte_fib6_get_dp(struct rte_fib6 *fib);
200 
210 __rte_experimental
211 struct rte_rib6 *
212 rte_fib6_get_rib(struct rte_fib6 *fib);
213 
226 __rte_experimental
227 int
228 rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type);
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 #endif /* _RTE_FIB6_H_ */
__rte_experimental int rte_fib6_lookup_bulk(struct rte_fib6 *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, int n)
int(* rte_fib6_modify_fn_t)(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop, int op)
Definition: rte_fib6.h:44
__rte_experimental void rte_fib6_free(struct rte_fib6 *fib)
rte_fib6_type
Definition: rte_fib6.h:38
enum rte_fib6_type type
Definition: rte_fib6.h:74
rte_fib_trie_nh_sz
Definition: rte_fib6.h:58
__rte_experimental void * rte_fib6_get_dp(struct rte_fib6 *fib)
__rte_experimental int rte_fib6_delete(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth)
__rte_experimental struct rte_fib6 * rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)
rte_fib6_lookup_type
Definition: rte_fib6.h:65
uint64_t default_nh
Definition: rte_fib6.h:76
void(* rte_fib6_lookup_fn_t)(void *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, const unsigned int n)
Definition: rte_fib6.h:48
__rte_experimental int rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop)
__rte_experimental struct rte_rib6 * rte_fib6_get_rib(struct rte_fib6 *fib)
__rte_experimental struct rte_fib6 * rte_fib6_find_existing(const char *name)
__rte_experimental int rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type)