DPDK 21.11.9
rte_fib.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_FIB_H_
7#define _RTE_FIB_H_
8
18#include <stdint.h>
19
20#include <rte_compat.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26struct rte_fib;
27struct rte_rib;
28
30#define RTE_FIB_MAXDEPTH 32
31
36};
37
39typedef int (*rte_fib_modify_fn_t)(struct rte_fib *fib, uint32_t ip,
40 uint8_t depth, uint64_t next_hop, int op);
42typedef void (*rte_fib_lookup_fn_t)(void *fib, const uint32_t *ips,
43 uint64_t *next_hops, const unsigned int n);
44
45enum rte_fib_op {
46 RTE_FIB_ADD,
47 RTE_FIB_DEL,
48};
49
52 RTE_FIB_DIR24_8_1B,
53 RTE_FIB_DIR24_8_2B,
54 RTE_FIB_DIR24_8_4B,
55 RTE_FIB_DIR24_8_8B
56};
57
75};
76
81 uint64_t default_nh;
82 int max_routes;
84 unsigned int rib_ext_sz;
85 union {
86 struct {
87 enum rte_fib_dir24_8_nh_sz nh_sz;
88 uint32_t num_tbl8;
89 } dir24_8;
90 };
91};
92
106struct rte_fib *
107rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf);
108
119struct rte_fib *
120rte_fib_find_existing(const char *name);
121
128void
129rte_fib_free(struct rte_fib *fib);
130
145int
146rte_fib_add(struct rte_fib *fib, uint32_t ip, uint8_t depth, uint64_t next_hop);
147
160int
161rte_fib_delete(struct rte_fib *fib, uint32_t ip, uint8_t depth);
162
180int
181rte_fib_lookup_bulk(struct rte_fib *fib, uint32_t *ips,
182 uint64_t *next_hops, int n);
192void *
193rte_fib_get_dp(struct rte_fib *fib);
194
204struct rte_rib *
205rte_fib_get_rib(struct rte_fib *fib);
206
219int
220rte_fib_select_lookup(struct rte_fib *fib, enum rte_fib_lookup_type type);
221
222#ifdef __cplusplus
223}
224#endif
225
226#endif /* _RTE_FIB_H_ */
void * rte_fib_get_dp(struct rte_fib *fib)
int rte_fib_delete(struct rte_fib *fib, uint32_t ip, uint8_t depth)
rte_fib_lookup_type
Definition: rte_fib.h:59
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI
Definition: rte_fib.h:69
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE
Definition: rte_fib.h:64
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO
Definition: rte_fib.h:62
@ RTE_FIB_LOOKUP_DEFAULT
Definition: rte_fib.h:60
@ RTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512
Definition: rte_fib.h:73
void(* rte_fib_lookup_fn_t)(void *fib, const uint32_t *ips, uint64_t *next_hops, const unsigned int n)
Definition: rte_fib.h:42
struct rte_fib * rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)
struct rte_fib * rte_fib_find_existing(const char *name)
rte_fib_dir24_8_nh_sz
Definition: rte_fib.h:51
struct rte_rib * rte_fib_get_rib(struct rte_fib *fib)
int rte_fib_select_lookup(struct rte_fib *fib, enum rte_fib_lookup_type type)
int(* rte_fib_modify_fn_t)(struct rte_fib *fib, uint32_t ip, uint8_t depth, uint64_t next_hop, int op)
Definition: rte_fib.h:39
void rte_fib_free(struct rte_fib *fib)
int rte_fib_lookup_bulk(struct rte_fib *fib, uint32_t *ips, uint64_t *next_hops, int n)
int rte_fib_add(struct rte_fib *fib, uint32_t ip, uint8_t depth, uint64_t next_hop)
rte_fib_type
Definition: rte_fib.h:33
@ RTE_FIB_DUMMY
Definition: rte_fib.h:34
@ RTE_FIB_DIR24_8
Definition: rte_fib.h:35
uint64_t default_nh
Definition: rte_fib.h:81
enum rte_fib_type type
Definition: rte_fib.h:79
unsigned int rib_ext_sz
Definition: rte_fib.h:84