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

  • 0 if the class matches the data.
  • !0 if the class does not match.
  • <0 if ordering is possible and the class is lower than the data.
  • >0 if 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 a rte_class structure 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 a rte_class structure 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