---
name: "rte_tailq.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_tailq.h"
---

# rte\_tailq.h(3)

## NAME

rte\_tailq.h

## 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)   	(struct struct\_name \*)&(tailq\_entry)-\>tailq\_head\
 \#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

Here defines rte\_tailq APIs for only internal use

Definition in file **rte\_tailq.h**.

## Macro Definition Documentation

### #define RTE\_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 **56** of file **rte\_tailq.h**.

### #define RTE\_TAILQ\_LOOKUP(name, struct\_name)

**Value:**.PP

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

Utility macro to make looking up a tailqueue for a particular struct easier.

**Parameters**

*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)

**Returns**

The return value from rte\_eal\_tailq\_lookup, typecast to the appropriate structure pointer type. NULL on error.

Definition at line **74** of file **rte\_tailq.h**.

## Function Documentation

### RTE\_TAILQ\_HEAD (rte\_tailq\_entry\_head, rte\_tailq\_entry)

dummy

### void rte\_dump\_tailq (FILE \* f)

Dump tail queues to a file.

**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: this function is not multi-thread safe, and should only be called from a single thread at a time

**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 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().

**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.
