rte_tailq.h(3)

πŸ’– NAME πŸ’–

rte_tailq.h β€” bestie, this is a Library Functions Manual situation (section 3, as the header up top says πŸ’…), so pull up a chair and let's get into it.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <stdio.h>
#include <rte_debug.h>

✨ Data Structures ✨

  • struct rte_tailq_entry
  • struct rte_tailq_head

πŸŽ€ Macros πŸŽ€

  • #define RTE_TAILQ_CAST(tailq_entry, struct_name)
  • #define RTE_TAILQ_LOOKUP(name, struct_name)

🌸 Functions 🌸

  • RTE_TAILQ_HEAD (rte_tailq_entry_head, rte_tailq_entry)
  • void rte_dump_tailq (FILE *f)
  • struct rte_tailq_head * rte_eal_tailq_lookup (const char *name)
  • int rte_eal_tailq_register (struct rte_tailq_elem *t)

πŸ”₯ Detailed Description πŸ”₯

Okay so here is where we define the rte_tailq APIs β€” and no cap, these are for internal use only. Like, this is not the API you show to your friends, it's the API that lives in your house and knows your wifi password. πŸ™ˆ

Definition in file rte_tailq.h.

πŸ’… Macro Definition Documentation πŸ’…

#define RTE_TAILQ_CAST( tailq_entry, struct_name)

Value:

(struct struct_name *)&(tailq_entry)->tailq_head

What does it do? It hands you back the first tailq entry, cast to the right struct. That's it, that's the whole vibe. ✨

Definition at line 56 of file rte_tailq.h.

#define RTE_TAILQ_LOOKUP( name, struct_name)

Value:

__extension__ ({ \
struct rte_tailq_head *head = rte_eal_tailq_lookup(name); \
head == NULL ? NULL : RTE_TAILQ_CAST(head, struct_name); \
})

A utility macro that makes looking up a tailqueue for one particular struct so much easier. It's giving "I got you, bestie." 🫢

Parameters

  • name β€” the name of tailq.
  • struct_name β€” the name of the list type we're using. (Generally this is the same as the first parameter passed to the TAILQ_HEAD macro.) πŸ‘‘

Returns

The return value from rte_eal_tailq_lookup, typecast to the appropriate structure pointer type. And NULL on error β€” because of course there's an error case, there always is. 😭

Definition at line 74 of file rte_tailq.h.

🌈 Function Documentation 🌈

RTE_TAILQ_HEAD (rte_tailq_entry_head , rte_tailq_entry )

dummy

That's literally the whole description. It said "dummy" and moved on. Iconic behaviour honestly. πŸ’€


void rte_dump_tailq (FILE * f)

Dump tail queues to a file. Just β€” yeet the whole thing into a file, fr fr. πŸ”₯

Parameters

  • f β€” a pointer to a file for output.

struct rte_tailq_head * rte_eal_tailq_lookup (const char * name)

Lookup for a tail queue. πŸ‘€

Get a pointer to a tail queue header of a tail queue identified by the name given as an argument.

Note, and this one matters: this function is not multi-thread safe, and should only be called from a single thread at a time. So don't be out here sharing it across threads like it's a group chat, bestie. 🚫🧡

Parameters

  • name β€” the name of the queue.

Returns

A pointer to the tail queue head structure.


int rte_eal_tailq_register (struct rte_tailq_elem * t)

Register a tail queue. ✍️

Register a tail queue from shared memory. This function is mainly used by the EAL_REGISTER_TAILQ macro, which is used to register tailq from the different dpdk libraries. Since this macro is a constructor, the function has no access to dpdk shared memory, so the registered tailq can not be used before call to rte_eal_init() which calls rte_eal_tailqs_init(). Read that part twice, it's important. 🫑

Parameters

  • t β€” the tailq element which contains the name of the tailq you want to create (/retrieve when in secondary process).

Returns

0 on success or -1 in case of an error.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for DPDK from the source code.


And that's a wrap, bestie! πŸŽ€ This whole page is DPDK Version 25.11.3 ✨ and it goes by rte_tailq.h(3) πŸ’œ β€” ty for coming to my ted talk, now go forth and cast some tailq entries. πŸ’…πŸŒΈ

πŸ“¦ where this page comes from