DPDK  1.6.0r2
Data Structures | Macros | Functions
rte_tailq.h File Reference
#include <sys/queue.h>

Data Structures

struct  rte_dummy
struct  rte_tailq_head

Macros

#define RTE_TAILQ_RESERVE(name, struct_name)   (struct struct_name *)(&rte_eal_tailq_reserve(name)->tailq_head)
#define RTE_TAILQ_RESERVE_BY_IDX(idx, struct_name)   (struct struct_name *)(&rte_eal_tailq_reserve_by_idx(idx)->tailq_head)
#define RTE_TAILQ_LOOKUP(name, struct_name)   (struct struct_name *)(&rte_eal_tailq_lookup(name)->tailq_head)
#define RTE_TAILQ_LOOKUP_BY_IDX(idx, struct_name)   (struct struct_name *)(&rte_eal_tailq_lookup_by_idx(idx)->tailq_head)

Functions

 TAILQ_HEAD (rte_dummy_head, rte_dummy)
struct rte_tailq_headrte_eal_tailq_reserve (const char *name)
struct rte_tailq_headrte_eal_tailq_reserve_by_idx (const unsigned idx)
void rte_dump_tailq (void)
struct rte_tailq_headrte_eal_tailq_lookup (const char *name)
struct rte_tailq_headrte_eal_tailq_lookup_by_idx (const unsigned idx)

Detailed Description

Here defines rte_tailq APIs for only internal use

Macro Definition Documentation

#define RTE_TAILQ_LOOKUP (   name,
  struct_name 
)    (struct struct_name *)(&rte_eal_tailq_lookup(name)->tailq_head)

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

Parameters
nameThe name of tailq
struct_nameThe 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, since the tailq_head is the first element in the rte_tailq_head structure.
#define RTE_TAILQ_LOOKUP_BY_IDX (   idx,
  struct_name 
)    (struct struct_name *)(&rte_eal_tailq_lookup_by_idx(idx)->tailq_head)

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

Parameters
idxThe tailq idx defined in rte_tail_t to be given to the tail queue.
struct_nameThe 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, since the tailq_head is the first element in the rte_tailq_head structure.
#define RTE_TAILQ_RESERVE (   name,
  struct_name 
)    (struct struct_name *)(&rte_eal_tailq_reserve(name)->tailq_head)

Utility macro to make reserving a tailqueue for a particular struct easier.

Parameters
nameThe name to be given to the tailq - used by lookup to find it later
struct_nameThe 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_reserve, typecast to the appropriate structure pointer type. NULL on error, since the tailq_head is the first element in the rte_tailq_head structure.
#define RTE_TAILQ_RESERVE_BY_IDX (   idx,
  struct_name 
)    (struct struct_name *)(&rte_eal_tailq_reserve_by_idx(idx)->tailq_head)

Utility macro to make reserving a tailqueue for a particular struct easier.

Parameters
idxThe tailq idx defined in rte_tail_t to be given to the tail queue.
  • used by lookup to find it later
struct_nameThe 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_reserve, typecast to the appropriate structure pointer type. NULL on error, since the tailq_head is the first element in the rte_tailq_head structure.

Function Documentation

void rte_dump_tailq ( void  )

Dump tail queues to the console.

struct rte_tailq_head* rte_eal_tailq_lookup ( const char *  name)
read

Lookup for a tail queue.

Get a pointer to a tail queue header of an already reserved tail queue identified by the name given as an argument. Note: this function, along with rte_tailq_reserve, is not multi-thread safe, and both these functions should only be called from a single thread at a time

Parameters
nameThe name of the queue.
Returns
A pointer to the tail queue head structure.
struct rte_tailq_head* rte_eal_tailq_lookup_by_idx ( const unsigned  idx)
read

Lookup for a tail queue.

Get a pointer to a tail queue header of an already reserved tail queue identified by the name given as an argument. Note: this function, along with rte_tailq_reserve, is not multi-thread safe, and both these functions should only be called from a single thread at a time

Parameters
idxThe tailq idx defined in rte_tail_t to be given to the tail queue.
Returns
A pointer to the tail queue head structure.
struct rte_tailq_head* rte_eal_tailq_reserve ( const char *  name)
read

Reserve a slot in the tailq list for a particular tailq header Note: this function, along with rte_tailq_lookup, is not multi-thread safe, and both these functions should only be called from a single thread at a time

Parameters
nameThe name to be given to the tail queue.
Returns
A pointer to the newly reserved tailq entry
struct rte_tailq_head* rte_eal_tailq_reserve_by_idx ( const unsigned  idx)
read

Reserve a slot in the tailq list for a particular tailq header Note: this function, along with rte_tailq_lookup, is not multi-thread safe, and both these functions should only be called from a single thread at a time

Parameters
idxThe tailq idx defined in rte_tail_t to be given to the tail queue.
Returns
A pointer to the newly reserved tailq entry
TAILQ_HEAD ( rte_dummy_head  ,
rte_dummy   
)

dummy