DPDK 22.11.7
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
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25struct rte_fib;
26struct rte_rib;
27
29#define RTE_FIB_MAXDEPTH 32
30
35};
36
38typedef int (*rte_fib_modify_fn_t)(struct rte_fib *fib, uint32_t ip,
39 uint8_t depth, uint64_t next_hop, int op);
41typedef void (*rte_fib_lookup_fn_t)(void *fib, const uint32_t *ips,
42 uint64_t *next_hops, const unsigned int n);
43
44enum rte_fib_op {
45 RTE_FIB_ADD,
46 RTE_FIB_DEL,
47};
48
51 RTE_FIB_DIR24_8_1B,
52 RTE_FIB_DIR24_8_2B,
53 RTE_FIB_DIR24_8_4B,
54 RTE_FIB_DIR24_8_8B
55};
56
74};
75
80 uint64_t default_nh;
81 int max_routes;
83 unsigned int rib_ext_sz;
84 union {
85 struct {
86 enum rte_fib_dir24_8_nh_sz nh_sz;
87 uint32_t num_tbl8;
88 } dir24_8;
89 };
90};
91
105struct rte_fib *
106rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf);
107
118struct rte_fib *
119rte_fib_find_existing(const char *name);
120
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:58
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI
Definition: rte_fib.h:68
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE
Definition: rte_fib.h:63
@ RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO
Definition: rte_fib.h:61
@ RTE_FIB_LOOKUP_DEFAULT
Definition: rte_fib.h:59
@ RTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512
Definition: rte_fib.h:72
void(* rte_fib_lookup_fn_t)(void *fib, const uint32_t *ips, uint64_t *next_hops, const unsigned int n)
Definition: rte_fib.h:41
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:50
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:38
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:32
@ RTE_FIB_DUMMY
Definition: rte_fib.h:33
@ RTE_FIB_DIR24_8
Definition: rte_fib.h:34
uint64_t default_nh
Definition: rte_fib.h:80
enum rte_fib_type type
Definition: rte_fib.h:78
unsigned int rib_ext_sz
Definition: rte_fib.h:83