DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_class.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright 2018 Gaƫtan Rivet
3
*/
4
5
#ifndef _RTE_CLASS_H_
6
#define _RTE_CLASS_H_
7
20
21
#include <
rte_dev.h
>
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
28
RTE_TAILQ_HEAD
(rte_class_list,
rte_class
);
29
33
struct
rte_class
{
34
RTE_TAILQ_ENTRY
(
rte_class
) next;
35
const
char
*
name
;
36
rte_dev_iterate_t
dev_iterate
;
37
};
38
54
typedef
int (*
rte_class_cmp_t
)(
const
struct
rte_class
*cls,
const
void
*data);
55
78
struct
rte_class
*
79
rte_class_find
(
const
struct
rte_class
*start,
rte_class_cmp_t
cmp,
80
const
void
*data);
81
85
struct
rte_class
*
86
rte_class_find_by_name
(
const
char
*
name
);
87
95
void
rte_class_register
(
struct
rte_class
*cls);
96
104
void
rte_class_unregister
(
struct
rte_class
*cls);
105
111
#define RTE_REGISTER_CLASS(nm, cls) \
112
RTE_INIT_PRIO(classinitfn_ ##nm, CLASS) \
113
{\
114
(cls).name = RTE_STR(nm); \
115
rte_class_register(&cls); \
116
}
117
118
#define RTE_UNREGISTER_CLASS(nm, cls) \
119
RTE_FINI_PRIO(classfinifn_ ##nm, CLASS) \
120
{ \
121
rte_class_unregister(&cls); \
122
}
123
124
#ifdef __cplusplus
125
}
126
#endif
127
128
#endif
/* _RTE_CLASS_H_ */
rte_class_unregister
void rte_class_unregister(struct rte_class *cls)
rte_class_find_by_name
struct rte_class * rte_class_find_by_name(const char *name)
rte_class_find
struct rte_class * rte_class_find(const struct rte_class *start, rte_class_cmp_t cmp, const void *data)
rte_class_cmp_t
int(* rte_class_cmp_t)(const struct rte_class *cls, const void *data)
Definition
rte_class.h:54
RTE_TAILQ_HEAD
RTE_TAILQ_HEAD(rte_class_list, rte_class)
rte_class_register
void rte_class_register(struct rte_class *cls)
rte_dev.h
rte_dev_iterate_t
void *(* rte_dev_iterate_t)(const void *start, const char *devstr, const struct rte_dev_iterator *it)
Definition
rte_dev.h:278
rte_class
Definition
rte_class.h:33
rte_class::dev_iterate
rte_dev_iterate_t dev_iterate
Definition
rte_class.h:36
rte_class::name
const char * name
Definition
rte_class.h:35
rte_class::RTE_TAILQ_ENTRY
RTE_TAILQ_ENTRY(rte_class) next
lib
eal
include
rte_class.h
Generated by
1.17.0