DPDK  24.07.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 
18 #include <stdint.h>
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define RTE_FIB6_IPV6_ADDR_SIZE 16
26 
27 #define RTE_FIB6_MAXDEPTH 128
28 
29 struct rte_fib6;
30 struct rte_rib6;
31 
36 };
37 
39 typedef int (*rte_fib6_modify_fn_t)(struct rte_fib6 *fib,
40  const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth,
41  uint64_t next_hop, int op);
43 typedef void (*rte_fib6_lookup_fn_t)(void *fib,
44  uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
45  uint64_t *next_hops, const unsigned int n);
46 
47 enum rte_fib6_op {
48  RTE_FIB6_ADD,
49  RTE_FIB6_DEL,
50 };
51 
54  RTE_FIB6_TRIE_2B = 1,
55  RTE_FIB6_TRIE_4B,
56  RTE_FIB6_TRIE_8B
57 };
58 
65 };
66 
68 struct rte_fib6_conf {
71  uint64_t default_nh;
72  int max_routes;
74  unsigned int rib_ext_sz;
75  union {
76  struct {
77  enum rte_fib_trie_nh_sz nh_sz;
78  uint32_t num_tbl8;
79  } trie;
80  };
81 };
82 
96 struct rte_fib6 *
97 rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
98 
109 struct rte_fib6 *
110 rte_fib6_find_existing(const char *name);
111 
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:39
int rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type)
rte_fib6_type
Definition: rte_fib6.h:33
void * rte_fib6_get_dp(struct rte_fib6 *fib)
enum rte_fib6_type type
Definition: rte_fib6.h:69
rte_fib_trie_nh_sz
Definition: rte_fib6.h:53
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:60
uint64_t default_nh
Definition: rte_fib6.h:71
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:43
unsigned int rib_ext_sz
Definition: rte_fib6.h:74
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)