DPDK  24.03.0
Data Structures | Macros | Functions
rte_pie.h File Reference
#include <stdint.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_cycles.h>

Go to the source code of this file.

Data Structures

struct  rte_pie_params
 
struct  rte_pie_config
 
struct  rte_pie
 

Macros

#define RTE_DQ_THRESHOLD   16384
 
#define RTE_DQ_WEIGHT   0.25
 
#define RTE_ALPHA   0.125
 
#define RTE_BETA   1.25
 
#define RTE_RAND_MAX   ~0LLU
 

Functions

int rte_pie_rt_data_init (struct rte_pie *pie)
 Initialises run-time data. More...
 
int rte_pie_config_init (struct rte_pie_config *pie_cfg, const uint16_t qdelay_ref, const uint16_t dp_update_interval, const uint16_t max_burst, const uint16_t tailq_th)
 Configures a single PIE configuration parameter structure. More...
 
static int rte_pie_enqueue_empty (const struct rte_pie_config *pie_cfg, struct rte_pie *pie, uint32_t pkt_len)
 Decides packet enqueue when queue is empty. More...
 
static void _calc_drop_probability (const struct rte_pie_config *pie_cfg, struct rte_pie *pie, uint64_t time)
 make a decision to drop or enqueue a packet based on probability criteria More...
 
static int _rte_pie_drop (const struct rte_pie_config *pie_cfg, struct rte_pie *pie)
 make a decision to drop or enqueue a packet based on probability criteria More...
 
static int rte_pie_enqueue_nonempty (const struct rte_pie_config *pie_cfg, struct rte_pie *pie, uint32_t pkt_len, const uint64_t time)
 Decides if new packet should be enqueued or dropped for non-empty queue. More...
 
static int rte_pie_enqueue (const struct rte_pie_config *pie_cfg, struct rte_pie *pie, const unsigned int qlen, uint32_t pkt_len, const uint64_t time)
 Decides if new packet should be enqueued or dropped Updates run time data and gives verdict whether to enqueue or drop the packet. More...
 
static void rte_pie_dequeue (struct rte_pie *pie, uint32_t pkt_len, uint64_t time)
 PIE rate estimation method Called on each packet departure. More...
 

Detailed Description

Proportional Integral controller Enhanced (PIE)

Definition in file rte_pie.h.

Macro Definition Documentation

◆ RTE_DQ_THRESHOLD

#define RTE_DQ_THRESHOLD   16384

Queue length threshold (2^14) to start measurement cycle (bytes)

Definition at line 23 of file rte_pie.h.

◆ RTE_DQ_WEIGHT

#define RTE_DQ_WEIGHT   0.25

Weight (RTE_DQ_THRESHOLD/2^16) to compute dequeue rate

Definition at line 28 of file rte_pie.h.

◆ RTE_ALPHA

#define RTE_ALPHA   0.125

Weights in drop probability calculations

Definition at line 29 of file rte_pie.h.

◆ RTE_BETA

#define RTE_BETA   1.25

Weights in drop probability calculations

Definition at line 30 of file rte_pie.h.

◆ RTE_RAND_MAX

#define RTE_RAND_MAX   ~0LLU

Max value of the random number

Definition at line 31 of file rte_pie.h.

Function Documentation

◆ rte_pie_rt_data_init()

int rte_pie_rt_data_init ( struct rte_pie pie)

Initialises run-time data.

Parameters
pie[in,out] data pointer to PIE runtime data
Returns
Operation status
Return values
0success
!0error

◆ rte_pie_config_init()

int rte_pie_config_init ( struct rte_pie_config pie_cfg,
const uint16_t  qdelay_ref,
const uint16_t  dp_update_interval,
const uint16_t  max_burst,
const uint16_t  tailq_th 
)

Configures a single PIE configuration parameter structure.

Parameters
pie_cfg[in,out] config pointer to a PIE configuration parameter structure
qdelay_ref[in] latency target(milliseconds)
dp_update_interval[in] update interval for drop probability (milliseconds)
max_burst[in] maximum burst allowance (milliseconds)
tailq_th[in] tail drop threshold for the queue (number of packets)
Returns
Operation status
Return values
0success
!0error

◆ rte_pie_enqueue_empty()

static int rte_pie_enqueue_empty ( const struct rte_pie_config pie_cfg,
struct rte_pie pie,
uint32_t  pkt_len 
)
static

Decides packet enqueue when queue is empty.

Note: packet is never dropped in this particular case.

Parameters
pie_cfg[in] config pointer to a PIE configuration parameter structure
pie[in, out] data pointer to PIE runtime data
pkt_len[in] packet length in bytes
Returns
Operation status
Return values
0enqueue the packet
!0drop the packet

If the queue has been idle for a while, turn off PIE and Reset counters

Definition at line 118 of file rte_pie.h.

◆ _calc_drop_probability()

static void _calc_drop_probability ( const struct rte_pie_config pie_cfg,
struct rte_pie pie,
uint64_t  time 
)
static

make a decision to drop or enqueue a packet based on probability criteria

Parameters
pie_cfg[in] config pointer to a PIE configuration parameter structure
pie[in, out] data pointer to PIE runtime data
time[in] current time (measured in cpu cycles)

Definition at line 149 of file rte_pie.h.

◆ _rte_pie_drop()

static int _rte_pie_drop ( const struct rte_pie_config pie_cfg,
struct rte_pie pie 
)
inlinestatic

make a decision to drop or enqueue a packet based on probability criteria

Parameters
pie_cfg[in] config pointer to a PIE configuration parameter structure
pie[in, out] data pointer to PIE runtime data
Returns
operation status
Return values
0enqueue the packet
1drop the packet

Definition at line 212 of file rte_pie.h.

◆ rte_pie_enqueue_nonempty()

static int rte_pie_enqueue_nonempty ( const struct rte_pie_config pie_cfg,
struct rte_pie pie,
uint32_t  pkt_len,
const uint64_t  time 
)
inlinestatic

Decides if new packet should be enqueued or dropped for non-empty queue.

Parameters
pie_cfg[in] config pointer to a PIE configuration parameter structure
pie[in,out] data pointer to PIE runtime data
pkt_len[in] packet length in bytes
time[in] current time (measured in cpu cycles)
Returns
Operation status
Return values
0enqueue the packet
1drop the packet based on max threshold criterion
2drop the packet based on mark probability criterion

Definition at line 260 of file rte_pie.h.

◆ rte_pie_enqueue()

static int rte_pie_enqueue ( const struct rte_pie_config pie_cfg,
struct rte_pie pie,
const unsigned int  qlen,
uint32_t  pkt_len,
const uint64_t  time 
)
inlinestatic

Decides if new packet should be enqueued or dropped Updates run time data and gives verdict whether to enqueue or drop the packet.

Parameters
pie_cfg[in] config pointer to a PIE configuration parameter structure
pie[in,out] data pointer to PIE runtime data
qlen[in] queue length
pkt_len[in] packet length in bytes
time[in] current time stamp (measured in cpu cycles)
Returns
Operation status
Return values
0enqueue the packet
1drop the packet based on drop probability criteria

Definition at line 327 of file rte_pie.h.

◆ rte_pie_dequeue()

static void rte_pie_dequeue ( struct rte_pie pie,
uint32_t  pkt_len,
uint64_t  time 
)
inlinestatic

PIE rate estimation method Called on each packet departure.

Parameters
pie[in] data pointer to PIE runtime data
pkt_len[in] packet length in bytes
time[in] current time stamp in cpu cycles

Definition at line 351 of file rte_pie.h.