CNDP
22.08.0
|
Go to the source code of this file.
Data Structures | |
struct | cne_tailq_entry |
struct | cne_tailq_head |
Macros | |
#define | CNE_TAILQ_CAST(tailq_entry, struct_name) (struct struct_name *)&(tailq_entry)->tailq_head |
#define | CNE_TAILQ_LOOKUP(name, struct_name) CNE_TAILQ_CAST(cne_tailq_lookup(name), struct_name) |
#define | TAILQ_FOREACH_SAFE(var, head, field, tvar) |
Functions | |
TAILQ_HEAD (cne_tailq_entry_head, cne_tailq_entry) | |
CNDP_API int | cne_tailqs_init (void) |
CNDP_API int | cne_tailq_register (struct cne_tailq_elem *t) |
CNDP_API void | cne_dump_tailq (void) |
CNDP_API struct cne_tailq_head * | cne_tailq_lookup (const char *name) |
CNDP_API int | cne_eal_tailq_register (struct cne_tailq_elem *t) |
Defines cne_tailq APIs to safely iterate over a list of items or structures. The tailq APIs add non-list items to a tailq list. Add items to a tailq list by allocating a cne_tailq_entry structure and adding the structure pointer to the cne_tailq_entry.data member. The calling function must supply protection against multiple accesses to a given cne_tailq list.
Definition in file cne_tailq.h.
#define CNE_TAILQ_CAST | ( | tailq_entry, | |
struct_name | |||
) | (struct struct_name *)&(tailq_entry)->tailq_head |
Return the first tailq entry cast to the right struct.
Definition at line 67 of file cne_tailq.h.
#define CNE_TAILQ_LOOKUP | ( | name, | |
struct_name | |||
) | CNE_TAILQ_CAST(cne_tailq_lookup(name), struct_name) |
Utility macro to make looking up a tailqueue for a particular struct easier.
name | The name of tailq |
struct_name | The name of the list type we are using. (Generally this is the same as the first parameter passed to TAILQ_HEAD macro) |
Definition at line 85 of file cne_tailq.h.
#define TAILQ_FOREACH_SAFE | ( | var, | |
head, | |||
field, | |||
tvar | |||
) |
This macro permits both remove and free var within the loop safely.
Definition at line 147 of file cne_tailq.h.
TAILQ_HEAD | ( | cne_tailq_entry_head | , |
cne_tailq_entry | |||
) |
dummy
CNDP_API int cne_tailqs_init | ( | void | ) |
Initialize the tailq structures.
CNDP_API int cne_tailq_register | ( | struct cne_tailq_elem * | t | ) |
Register the given tailq entry.
t | The tailq element to register. |
CNDP_API void cne_dump_tailq | ( | void | ) |
Dump tail queues to stdout.
CNDP_API struct cne_tailq_head* cne_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: this function is not multi-thread safe, and should only be called from a single thread at a time
name | The name of the queue. |
CNDP_API int cne_eal_tailq_register | ( | struct cne_tailq_elem * | t | ) |
Register a tail queue.
Register a tail queue from shared memory. This function is mainly used by some, which is used to register tailq from the different cndp libraries. Since this macro is a constructor.
t | The tailq element which contains the name of the tailq you want to create (/retrieve when in secondary process). |