DPDK  24.11.0-rc3
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_common.h>
21 #include <rte_ip6.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define RTE_FIB6_IPV6_ADDR_SIZE (RTE_DEPRECATED(RTE_FIB6_IPV6_ADDR_SIZE) RTE_IPV6_ADDR_SIZE)
28 
29 #define RTE_FIB6_MAXDEPTH (RTE_DEPRECATED(RTE_FIB6_MAXDEPTH) RTE_IPV6_MAX_DEPTH)
30 
31 struct rte_fib6;
32 struct rte_rib6;
33 
38 };
39 
41 typedef int (*rte_fib6_modify_fn_t)(struct rte_fib6 *fib,
42  const struct rte_ipv6_addr *ip, uint8_t depth,
43  uint64_t next_hop, int op);
45 typedef void (*rte_fib6_lookup_fn_t)(void *fib,
46  const struct rte_ipv6_addr *ips,
47  uint64_t *next_hops, const unsigned int n);
48 
49 enum rte_fib6_op {
50  RTE_FIB6_ADD,
51  RTE_FIB6_DEL,
52 };
53 
56  RTE_FIB6_TRIE_2B = 1,
57  RTE_FIB6_TRIE_4B,
58  RTE_FIB6_TRIE_8B
59 };
60 
67 };
68 
70 struct rte_fib6_conf {
73  uint64_t default_nh;
74  int max_routes;
76  unsigned int rib_ext_sz;
77  union {
78  struct {
79  enum rte_fib_trie_nh_sz nh_sz;
80  uint32_t num_tbl8;
81  } trie;
82  };
83 };
84 
98 struct rte_fib6 *
99 rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
100 
111 struct rte_fib6 *
112 rte_fib6_find_existing(const char *name);
113 
121 void
122 rte_fib6_free(struct rte_fib6 *fib);
123 
138 int
139 rte_fib6_add(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip,
140  uint8_t depth, uint64_t next_hop);
141 
154 int
155 rte_fib6_delete(struct rte_fib6 *fib,
156  const struct rte_ipv6_addr *ip, uint8_t depth);
157 
175 int
176 rte_fib6_lookup_bulk(struct rte_fib6 *fib,
177  const struct rte_ipv6_addr *ips,
178  uint64_t *next_hops, int n);
179 
189 void *
190 rte_fib6_get_dp(struct rte_fib6 *fib);
191 
201 struct rte_rib6 *
202 rte_fib6_get_rib(struct rte_fib6 *fib);
203 
216 int
217 rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type);
218 
219 #ifdef __cplusplus
220 }
221 #endif
222 
223 #endif /* _RTE_FIB6_H_ */
void rte_fib6_free(struct rte_fib6 *fib)
int rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type)
rte_fib6_type
Definition: rte_fib6.h:35
void * rte_fib6_get_dp(struct rte_fib6 *fib)
enum rte_fib6_type type
Definition: rte_fib6.h:71
rte_fib_trie_nh_sz
Definition: rte_fib6.h:55
void(* rte_fib6_lookup_fn_t)(void *fib, const struct rte_ipv6_addr *ips, uint64_t *next_hops, const unsigned int n)
Definition: rte_fib6.h:45
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:62
uint64_t default_nh
Definition: rte_fib6.h:73
int(* rte_fib6_modify_fn_t)(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip, uint8_t depth, uint64_t next_hop, int op)
Definition: rte_fib6.h:41
int rte_fib6_add(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip, uint8_t depth, uint64_t next_hop)
unsigned int rib_ext_sz
Definition: rte_fib6.h:76
int rte_fib6_lookup_bulk(struct rte_fib6 *fib, const struct rte_ipv6_addr *ips, uint64_t *next_hops, int n)
int rte_fib6_delete(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip, uint8_t depth)
struct rte_fib6 * rte_fib6_find_existing(const char *name)