rte_pie.h(3)
๐ rte_pie.h(3) โ like, the DPDK PIE header bestie ๐ฅง
okay so this is rte_pie.h(3), straight out of DPDK, and it's giving "the entire Proportional Integral controller Enhanced header file, documented" energy. come sit with me, we're gonna go through it together ๐
โจ NAME โจ
rte_pie.h โ that's it, that's the name, no cap ๐
๐ธ SYNOPSIS ๐ธ
first things first, the includes you're gonna need โ copy these exactly, don't be cute with them:
#include <stdint.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_cycles.h>
๐ฆ Data Structures
struct rte_pie_paramsstruct rte_pie_configstruct rte_pie
three structs, all iconic, all doing their own thing โจ
๐ 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. lowkey the setup queen.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. yes bestie, all those params are required, no skipping ๐ญ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.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.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.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.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.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.
๐ Detailed Description ๐
Proportional Integral controller Enhanced (PIE) โ yes that's the whole sentence, she's concise, she's mysterious, she ate ๐
definition lives in file rte_pie.h.
๐ Macro Definition Documentation ๐
๐ #define RTE_DQ_THRESHOLD 16384
queue length threshold (2^14) to start the measurement cycle, in bytes. that's the trigger point fr fr.
definition at line 25 of file rte_pie.h.
๐ #define RTE_DQ_WEIGHT 0.25
weight (RTE_DQ_THRESHOLD/2^16) used to compute the dequeue rate. math girlies rise ๐งฎ
definition at line 26 of file rte_pie.h.
๐ #define RTE_ALPHA 0.125
one of the weights in the drop probability calculations โจ
definition at line 27 of file rte_pie.h.
๐ #define RTE_BETA 1.25
also a weight in the drop probability calculations. alpha's bestie ๐ซถ
definition at line 28 of file rte_pie.h.
๐ #define RTE_RAND_MAX ~0LLU
max value of the random number. she's the ceiling, literally.
definition at line 29 of file rte_pie.h.
โญ Function Documentation โญ
๐ int rte_pie_rt_data_init (struct rte_pie * pie)
initialises run-time data. the glow-up before the glow-up.
Parameters
pie[in,out]โ data pointer to PIE runtime data
Returns
operation status
Return values
0โ success (slay)!0โ error (uh oh ๐ญ)
๐ 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. this is where you set the vibes for the whole thing.
Parameters
pie_cfg[in,out]โ config pointer to a PIE configuration parameter structureqdelay_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
0โ success!0โ error
๐ 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 the queue is empty. note: packet is never dropped in this particular case โ she gets a free pass, no questions asked ๐
Parameters
pie_cfg[in]โ config pointer to a PIE configuration parameter structurepie[in, out]โ data pointer to PIE runtime datapkt_len[in]โ packet length in bytes
Returns
operation status
Return values
0โ enqueue the packet!0โ drop the packet
if the queue has been idle for a while, turn off PIE and reset counters ๐
definition at line 116 of file rte_pie.h.
๐ 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. the math is mathing ๐
Parameters
pie_cfg[in]โ config pointer to a PIE configuration parameter structurepie[in, out]โ data pointer to PIE runtime datatime[in]โ current time (measured in cpu cycles)
definition at line 147 of file rte_pie.h.
๐ static int _rte_pie_drop (const struct rte_pie_config * pie_cfg, struct rte_pie * pie) [inline], [static]
make a decision to drop or enqueue a packet based on probability criteria. yes, same one-liner as the function above, she's a rerun but she's still valid โจ
Parameters
pie_cfg[in]โ config pointer to a PIE configuration parameter structurepie[in, out]โ data pointer to PIE runtime data
Returns
operation status
Return values
0โ enqueue the packet1โ drop the packet
definition at line 210 of file rte_pie.h.
๐ 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) [inline], [static]
decides if a new packet should be enqueued or dropped for a non-empty queue. the queue's already got people in it, so now it's serious.
Parameters
pie_cfg[in]โ config pointer to a PIE configuration parameter structurepie[in,out]โ data pointer to PIE runtime datapkt_len[in]โ packet length in bytestime[in]โ current time (measured in cpu cycles)
Returns
operation status
Return values
0โ enqueue the packet1โ drop the packet based on max threshold criterion2โ drop the packet based on mark probability criterion
definition at line 258 of file rte_pie.h.
๐ 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) [inline], [static]
decides if a new packet should be enqueued or dropped. updates run time data and gives the verdict whether to enqueue or drop the packet. she's the main character of this whole file honestly ๐
Parameters
pie_cfg[in]โ config pointer to a PIE configuration parameter structurepie[in,out]โ data pointer to PIE runtime dataqlen[in]โ queue lengthpkt_len[in]โ packet length in bytestime[in]โ current time stamp (measured in cpu cycles)
Returns
operation status
Return values
0โ enqueue the packet1โ drop the packet based on drop probability criteria
definition at line 325 of file rte_pie.h.
๐ static void rte_pie_dequeue (struct rte_pie * pie, uint32_t pkt_len, uint64_t time) [inline], [static]
PIE rate estimation method. called on each packet departure. bye bestie, we'll miss you ๐ซถ
Parameters
pie[in]โ data pointer to PIE runtime datapkt_len[in]โ packet length in bytestime[in]โ current time stamp in cpu cycles
definition at line 349 of file rte_pie.h.
๐ Author ๐
generated automatically by Doxygen for DPDK from the source code. not a human, just a robot doing its little thing ๐คโจ
and that's the whole page! shoutout version 25.11.0, dated Fri Jan 30 2026 โ that's the footer, that's the vibe check, we're done here. mwah ๐๐
๐ฆ where this page comes from
- centos-stream 9: dpdk-devel 2:25.11-1.el9 ยท BSD and LGPLv2 and GPLv2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms