rte_pie.h(3)

πŸ“¦ version 26.03, in nixos 26.05, nixpkgs unstable

πŸ’… rte_pie.h(3) β€” Library Functions Manual πŸ’…

okay bestie, so this is a page from the Library Functions Manual about rte_pie.h, and no cap, it's giving "networking internals but make it cute." PIE stands for Proportional Integral controller Enhanced, which sounds like a math class you'd skip but actually it's the thing deciding whether your packets get in or get yeeted. let's get into it 🫢


✨ NAME ✨

rte_pie.h β€” literally just the header. that's the name. iconic minimalism, honestly. πŸ‘‘


🌸 SYNOPSIS 🌸

#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

πŸŽ€ 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.
  • 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.
  • 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) πŸ’–

ok so that's the whole vibe of this file. it's PIE. it controls queues. it's proportional AND integral AND enhanced, which is a lot of adjectives but we respect the hustle.

Definition in file rte_pie.h.


✨ Macro Definition Documentation ✨

πŸ“ #define RTE_DQ_THRESHOLD 16384

Queue length threshold (2^14) to start measurement cycle (bytes) πŸ“

Definition at line 23 of file rte_pie.h.

πŸ“ #define RTE_DQ_WEIGHT 0.25

Weight (RTE_DQ_THRESHOLD/2^16) to compute dequeue rate βš–οΈ

Definition at line 26 of file rte_pie.h.

πŸ“ #define RTE_ALPHA 0.125

Weights in drop probability calculations 🎚️

Definition at line 27 of file rte_pie.h.

πŸ“ #define RTE_BETA 1.25

Weights in drop probability calculations 🎚️ (yes, same description as alpha, they're a matched set, it's giving duo energy)

Definition at line 28 of file rte_pie.h.

πŸ“ #define RTE_RAND_MAX ~0LLU

Max value of the random number 🎲

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. like setting up the whole personality of your PIE instance before it goes out into the world ✨

Parameters

  • pie [in,out] β€” data pointer to PIE runtime data

Returns

Operation status

Return values

  • 0 β€” success πŸŽ‰
  • !0 β€” error 😭

🌈 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 tell PIE how to behave, and it listens, because it's a good little controller πŸŽ€

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 😭

🌈 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. 😌 empty queue? everybody eats. no drama.

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.


🌈 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 🎲 this is the "should I be messy right now" function, and the answer is mathematically determined.

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.


🌈 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 🎲 (same description, different function β€” they're siblings, it's a whole family)

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.


🌈 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 new packet should be enqueued or dropped for non-empty queue. now the queue has opinions, and those opinions involve thresholds πŸ”₯

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.


🌈 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 new packet should be enqueued or dropped. Updates run time data and gives verdict whether to enqueue or drop the packet. the main character function, honestly πŸ‘‘ it updates its own bookkeeping AND judges you at the same time.

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.


🌈 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 packet! now we do math about how fast you left so we can estimate the rate.

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. so nobody wrote this in a human sense, the robot did it, and honestly it did a pretty good job 🧚


no cap bestie, everything above is exactly what the page says β€” nothing added, nothing skipped, all the line numbers and return codes intact. iykyk πŸ’…

that's the whole page!! huge thank you to DPDK, Version 26.03.0 for sponsoring this episode of "networking headers explained by your emotional support group chat," and to rte_pie.h(3) itself, which we read cover to cover. mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from