DPDK 22.11.5
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
22extern "C" {
23#endif
24
25#define RTE_FIB6_IPV6_ADDR_SIZE 16
27#define RTE_FIB6_MAXDEPTH 128
28
29struct rte_fib6;
30struct rte_rib6;
31
36};
37
39typedef 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);
43typedef 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
47enum 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
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
96struct rte_fib6 *
97rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
98
109struct rte_fib6 *
110rte_fib6_find_existing(const char *name);
111
119void
120rte_fib6_free(struct rte_fib6 *fib);
121
136int
137rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],
138 uint8_t depth, uint64_t next_hop);
139
152int
153rte_fib6_delete(struct rte_fib6 *fib,
154 const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth);
155
173int
174rte_fib6_lookup_bulk(struct rte_fib6 *fib,
175 uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE],
176 uint64_t *next_hops, int n);
177
187void *
188rte_fib6_get_dp(struct rte_fib6 *fib);
189
199struct rte_rib6 *
200rte_fib6_get_rib(struct rte_fib6 *fib);
201
214int
215rte_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_ */
rte_fib6_lookup_type
Definition: rte_fib6.h:60
@ RTE_FIB6_LOOKUP_TRIE_VECTOR_AVX512
Definition: rte_fib6.h:64
@ RTE_FIB6_LOOKUP_DEFAULT
Definition: rte_fib6.h:61
@ RTE_FIB6_LOOKUP_TRIE_SCALAR
Definition: rte_fib6.h:63
struct rte_rib6 * rte_fib6_get_rib(struct rte_fib6 *fib)
rte_fib6_type
Definition: rte_fib6.h:33
@ RTE_FIB6_TRIE
Definition: rte_fib6.h:35
@ RTE_FIB6_DUMMY
Definition: rte_fib6.h:34
void * rte_fib6_get_dp(struct rte_fib6 *fib)
int rte_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type)
int rte_fib6_lookup_bulk(struct rte_fib6 *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, int n)
rte_fib_trie_nh_sz
Definition: rte_fib6.h:53
void rte_fib6_free(struct rte_fib6 *fib)
int rte_fib6_delete(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth)
struct rte_fib6 * rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)
struct rte_fib6 * rte_fib6_find_existing(const char *name)
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
int rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop)
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
enum rte_fib6_type type
Definition: rte_fib6.h:69
uint64_t default_nh
Definition: rte_fib6.h:71
unsigned int rib_ext_sz
Definition: rte_fib6.h:74