rte_class.h(3)
π¦ rte_class.h π¦
okay bestie, welcome to the Library Functions Manual page for rte_class.h β yes it's a real one, and yes it's literally the blueprint for how DPDK knows what kind of device it's looking at. sit down, hydrate, let's go π
πΈ NAME πΈ
rte_class.h
β¨ SYNOPSIS β¨
#include <rte_dev.h>
π Data Structures
struct rte_class
π Macros
#define RTE_REGISTER_CLASS(nm, cls)
π Typedefs
typedef int(* rte_class_cmp_t) (const struct rte_class *cls, const void *data)
π Functions
RTE_TAILQ_HEAD (rte_class_list, rte_class)struct rte_class * rte_class_find (const struct rte_class *start, rte_class_cmp_t cmp, const void *data)struct rte_class * rte_class_find_by_name (const char *name)void rte_class_register (struct rte_class *cls)void rte_class_unregister (struct rte_class *cls)
π DESCRIPTION π
DPDK device class interface. that's the whole vibe, but let me elaborate because this file is lowkey iconic.
This file describes the interface of the device class abstraction layer β it's doing the most so you don't have to. π«Ά
So like, a device class defines the type of function a device will be used for, for example:
- Ethernet adapter (
eth) - cryptographic co-processor (
crypto) - etc.
basically it's the "what's your job bestie" tag that every device wears. π
Definition in file rte_class.h.
π Macro Definition Documentation π
π #define RTE_REGISTER_CLASS( nm, cls)
Value:
RTE_INIT_PRIO(classinitfn_ ##nm, CLASS) \
{\
(cls).name = RTE_STR(nm); \
rte_class_register(&cls); \
}
Helper for Class registration. The constructor has lower priority than Bus constructors. The constructor has higher priority than PMD constructors. no cap, priority order is the whole plot twist here π
Definition at line 111 of file rte_class.h.
π¦ Typedef Documentation π¦
β typedef int(* rte_class_cmp_t) (const struct rte_class *cls, const void *data)
Class comparison function. it compares, it decides, it serves cunt π
Parameters
clsβ Class under test.dataβ Data to compare against.
Returns
0if the class matches the data.!0if the class does not match.<0if ordering is possible and the class is lower than the data.>0if ordering is possible and the class is greater than the data.
Definition at line 54 of file rte_class.h.
π₯ Function Documentation π₯
π RTE_TAILQ_HEAD (rte_class_list , rte_class )
Double linked list of classes. a whole squad, chained together, gossiping in both directions π
π struct rte_class * rte_class_find (const struct rte_class * start, rte_class_cmp_t cmp, const void * data)
Class iterator to find a particular class β it's giving detective energy, fr fr π
This function compares each registered class to find one that matches the data passed as parameter.
If the comparison function returns zero, this function will stop iterating over any more classes. To continue a search, the class of a previous search can be passed via the start parameter. (so yes, you can resume the hunt where you left off, main character behaviour π)
Parameters
startβ Starting point for the iteration.cmpβ Comparison function.dataβ Data to pass to comparison function.
Returns
A pointer to a rte_class structure or NULL in case no class matches.
πΈ struct rte_class * rte_class_find_by_name (const char * name)
Find the registered class for a given name. you give it a name, it gives you the class. simple. elegant. slay. β¨
π void rte_class_register (struct rte_class * cls)
Register a Class handle.
Parameters
clsβ A pointer to arte_classstructure describing the class to be registered.
π§ void rte_class_unregister (struct rte_class * cls)
Unregister a Class handle. the breakup arc π (but make it technical)
Parameters
clsβ A pointer to arte_classstructure describing the class to be unregistered.
π AUTHOR π
Generated automatically by Doxygen for DPDK from the source code. not a human author, just a robot doing its lil thing π€π
and that's the whole page bestie, we ate and left no crumbs π½οΈπ
this lil masterpiece came to you courtesy of DPDK, Version 25.11.3, page rte_class.h(3) β mwah, see you in the next one π«Άπ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms