DPDK 21.11.9
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
23extern "C" {
24#endif
25
26#define RTE_FIB6_IPV6_ADDR_SIZE 16
28#define RTE_FIB6_MAXDEPTH 128
29
30struct rte_fib6;
31struct rte_rib6;
32
37};
38
40typedef 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);
44typedef 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
48enum 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
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
97struct rte_fib6 *
98rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf);
99
110struct rte_fib6 *
111rte_fib6_find_existing(const char *name);
112
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:61
@ RTE_FIB6_LOOKUP_TRIE_VECTOR_AVX512
Definition: rte_fib6.h:65
@ RTE_FIB6_LOOKUP_DEFAULT
Definition: rte_fib6.h:62
@ RTE_FIB6_LOOKUP_TRIE_SCALAR
Definition: rte_fib6.h:64
struct rte_rib6 * rte_fib6_get_rib(struct rte_fib6 *fib)
rte_fib6_type
Definition: rte_fib6.h:34
@ RTE_FIB6_TRIE
Definition: rte_fib6.h:36
@ RTE_FIB6_DUMMY
Definition: rte_fib6.h:35
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:54
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:44
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:40
enum rte_fib6_type type
Definition: rte_fib6.h:70
uint64_t default_nh
Definition: rte_fib6.h:72
unsigned int rib_ext_sz
Definition: rte_fib6.h:75