DPDK  21.11.8
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 
18 #include <stdint.h>
19 
20 #include <rte_compat.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #define RTE_FIB6_IPV6_ADDR_SIZE 16
27 
28 #define RTE_FIB6_MAXDEPTH 128
29 
30 struct rte_fib6;
31 struct rte_rib6;
32 
37 };
38 
40 typedef int (*rte_fib6_modify_fn_t)(struct rte_fib6 *fib,
41  const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth,
42  uint64_t next_hop, int op);
44 typedef void (*rte_fib6_lookup_fn_t)(void *fib,
45  uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
46  uint64_t *next_hops, const unsigned int n);
47 
48 enum rte_fib6_op {
49  RTE_FIB6_ADD,
50  RTE_FIB6_DEL,
51 };
52 
55  RTE_FIB6_TRIE_2B = 1,
56  RTE_FIB6_TRIE_4B,
57  RTE_FIB6_TRIE_8B
58 };
59 
66 };
67 
69 struct rte_fib6_conf {
72  uint64_t default_nh;
73  int max_routes;
75  unsigned int rib_ext_sz;
76  union {
77  struct {
78  enum rte_fib_trie_nh_sz nh_sz;
79  uint32_t num_tbl8;
80  } trie;
81  };
82 };
83 
97 struct rte_fib6 *
98 rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
99 
110 struct rte_fib6 *
111 rte_fib6_find_existing(const char *name);
112 
119 void
120 rte_fib6_free(struct rte_fib6 *fib);
121 
136 int
137 rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],
138  uint8_t depth, uint64_t next_hop);
139 
152 int
153 rte_fib6_delete(struct rte_fib6 *fib,
154  const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth);
155 
173 int
174 rte_fib6_lookup_bulk(struct rte_fib6 *fib,
175  uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
176  uint64_t *next_hops, int n);
177 
187 void *
188 rte_fib6_get_dp(struct rte_fib6 *fib);
189 
199 struct rte_rib6 *
200 rte_fib6_get_rib(struct rte_fib6 *fib);
201 
214 int
215 rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type);
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif /* _RTE_FIB6_H_ */
void rte_fib6_free(struct rte_fib6 *fib)
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:40
int rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type)
rte_fib6_type
Definition: rte_fib6.h:34
void * rte_fib6_get_dp(struct rte_fib6 *fib)
enum rte_fib6_type type
Definition: rte_fib6.h:70
rte_fib_trie_nh_sz
Definition: rte_fib6.h:54
struct rte_fib6 * rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)
struct rte_rib6 * rte_fib6_get_rib(struct rte_fib6 *fib)
rte_fib6_lookup_type
Definition: rte_fib6.h:61
uint64_t default_nh
Definition: rte_fib6.h:72
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_delete(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth)
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:44
unsigned int rib_ext_sz
Definition: rte_fib6.h:75
struct rte_fib6 * rte_fib6_find_existing(const char *name)
int rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop)