Data Accelerator Offload
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
dao_portq_group_worker.h File Reference
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include <signal.h>
#include <assert.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_debug.h>
#include <dao_portq_group.h>
#include <dao_log.h>
#include <dao_util.h>

Go to the source code of this file.

Data Structures

struct  dao_portq_list
 
struct  dao_portq_group
 
struct  dao_portq_group_main
 

Macros

#define DAO_PORTQ_GROUP_NAMELEN   64
 
#define DAO_PORTQ_INVALID_VALUE   ((uint32_t)(~1))
 
#define DAO_PORTQ_GROUP_FOREACH_CORE(epg, core_id, portq, i)
 

Typedefs

typedef struct dao_portq_list dao_portq_list_t
 
typedef struct dao_portq_group_main dao_portq_group_main_t
 

Functions

static struct dao_portq_groupdao_portq_group_get (dao_portq_group_t epg)
 
static dao_portq_list_t__dao_portq_group_list_get (struct dao_portq_group *epg, uint32_t core_id)
 
static dao_portq_list_tdao_portq_group_list_get (dao_portq_group_t epg, uint32_t core_id)
 
static int32_t dao_portq_group_portq_get_next (dao_portq_group_t epg, uint32_t core_id, dao_portq_t **portq, int32_t index)
 

Detailed Description

dao_portq_group_worker.h

Fast Path PortQ [port, queue] group APIs

Once application creates dao_portq_group_t and assign dao_portq_t by core_id in control path, on each worker, list of dao_portq_t (aka dao_portq_list_t) can be retrieved using dao_portq_group_list_get().

Caller either can manually iterate over dao_portq_list_t OR use fast path defined macro DAO_PORTQ_GROUP_FOREACH_CORE()

Definition in file dao_portq_group_worker.h.

Macro Definition Documentation

◆ DAO_PORTQ_GROUP_NAMELEN

#define DAO_PORTQ_GROUP_NAMELEN   64

Max length of portq group name

Definition at line 44 of file dao_portq_group_worker.h.

◆ DAO_PORTQ_INVALID_VALUE

#define DAO_PORTQ_INVALID_VALUE   ((uint32_t)(~1))

Default value, if uninitialized

Definition at line 45 of file dao_portq_group_worker.h.

◆ DAO_PORTQ_GROUP_FOREACH_CORE

#define DAO_PORTQ_GROUP_FOREACH_CORE (   epg,
  core_id,
  portq,
 
)
Value:
for (i = dao_portq_group_portq_get_next(epg, core_id, &portq, -1); \
(i > -1) && (portq->port_id != DAO_PORTQ_INVALID_VALUE); \
i = dao_portq_group_portq_get_next(epg, core_id, &portq, i))
static int32_t dao_portq_group_portq_get_next(dao_portq_group_t epg, uint32_t core_id, dao_portq_t **portq, int32_t index)
#define DAO_PORTQ_INVALID_VALUE

Fast path macro for iterating over dao_portq_t

Usage:

Parameters
epgdao_portq_group_t object.
core_idcore_id ranging from 0 to "num_cores-1" (provided in dao_portq_group_create()) Type: (uint32_t)
portqPointer to dao_portq_t
iIterator. (int32_t)

Definition at line 237 of file dao_portq_group_worker.h.

Typedef Documentation

◆ dao_portq_list_t

List/Array of dao_portq_t

◆ dao_portq_group_main_t

dao portq_group main

Function Documentation

◆ dao_portq_group_get()

static struct dao_portq_group * dao_portq_group_get ( dao_portq_group_t  epg)
inlinestatic

Function definitions Translate from public portq_group object to internal structure

Definition at line 126 of file dao_portq_group_worker.h.

◆ __dao_portq_group_list_get()

static dao_portq_list_t * __dao_portq_group_list_get ( struct dao_portq_group epg,
uint32_t  core_id 
)
inlinestatic

Fast path API: Get list of dao_portq_t for core_id in a portq_group object

Parameters
epgPointer to struct dao_portq_group
core_idCore_id ranging from 0 to "num_cores -1" (dao_portq_group_create())
Returns
dao_portq_list_t List of dao_portq_t for a core

Definition at line 147 of file dao_portq_group_worker.h.

◆ dao_portq_group_list_get()

static dao_portq_list_t * dao_portq_group_list_get ( dao_portq_group_t  epg,
uint32_t  core_id 
)
inlinestatic

Per core Fast path API: Get list of dao_portq_t for core_id in a portq_group object

Parameters
epgdao_portq_group_t object
core_idCore_id ranging from 0 to "num_cores -1" (dao_portq_group_create())
Returns
dao_portq_list_t List of dao_portq_t for a core

Definition at line 171 of file dao_portq_group_worker.h.

◆ dao_portq_group_portq_get_next()

static int32_t dao_portq_group_portq_get_next ( dao_portq_group_t  epg,
uint32_t  core_id,
dao_portq_t **  portq,
int32_t  index 
)
inlinestatic

Fast path API for getting first "dao_portq_t" from a portq_group whose returned_index (

See also
dao_portq_group_portq_add() is greater than "index" parameter. This function helps to iterate over a port group. -1 is valid value for "index" parameter
Parameters
epg"dao_port_group_t" object.
core_idcore_id ranging from 0 to "num_cores-1" (provided in dao_portq_group_create())
[out]portqPointer to "dao_portq_t *". Valid if function returns 0
[out]index-1 or Returned index from dao_port_group_port_get_next() or dao_port_group_port_add()
Returns
>=0: Success. Returns index where returned "port" is saved <0: Failure

Definition at line 195 of file dao_portq_group_worker.h.