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_params
  • struct rte_pie_config
  • struct 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 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

  • 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 structure
  • pie [in, out] โ€” data pointer to PIE runtime data
  • pkt_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 structure
  • pie [in, out] โ€” data pointer to PIE runtime data
  • time [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 structure
  • pie [in, out] โ€” data pointer to PIE runtime data

Returns

operation status

Return values

  • 0 โ€” enqueue the packet
  • 1 โ€” 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 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

  • 0 โ€” enqueue the packet
  • 1 โ€” drop the packet based on max threshold criterion
  • 2 โ€” 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 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

  • 0 โ€” enqueue the packet
  • 1 โ€” 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 data
  • pkt_len [in] โ€” packet length in bytes
  • time [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