rte_latencystats.h(3)
πΈ rte_latencystats.h(3) πΈ
okay bestie, welcome to the DPDK Library Functions Manual π this is the page for rte_latencystats.h, and it's literally all about latency stats. grab a matcha, we're doing this π
β¨ NAME β¨
rte_latencystats.h β the header that gives you app-level and flow-based latency stats, no cap π
π SYNOPSIS π
first things first, the includes you need to pull in π
#include <stdint.h>
#include <rte_metrics.h>
#include <rte_mbuf.h>
π Typedefs
typedef uint16_t(* rte_latency_stats_flow_type_fn) (struct rte_mbuf
*pkt, void *user_param)
π¦ Functions
int rte_latencystats_init (uint64_t samp_intvl,
rte_latency_stats_flow_type_fn user_cb)
int32_t rte_latencystats_update (void)
int rte_latencystats_uninit (void)
int rte_latencystats_get_names (struct rte_metric_name *names, uint16_t
size)
int rte_latencystats_get (struct rte_metric_value *values, uint16_t
size)
π Detailed Description π
RTE latency stats β it's giving "library to provide application and flow based latency stats." β¨
Definition in file rte_latencystats.h.
π§ Typedef Documentation π§
π typedef uint16_t(* rte_latency_stats_flow_type_fn) (struct rte_mbuf *pkt, void *user_param)
Note: This function pointer is for future flow based latency stats implementation.
it's the function type used for identifying flow types of a Rx packet π«Ά
The callback function is called on Rx for each packet, bestie. This function is used for flow based latency calculations.
Parameters
pktβ Packet that has to be identified with its flow types.user_paramβ The arbitrary user parameter passed in by the application when the callback was originally configured.
Returns
- The
flow_mask, representing the multiple flow types of a packet. π«
Definition at line 40 of file rte_latencystats.h.
π Function Documentation π
πΈ int rte_latencystats_init (uint64_t samp_intvl, rte_latency_stats_flow_type_fn user_cb)
Registers Rx/Tx callbacks for each active port, queue. iconic behaviour honestly π
Parameters
samp_intvlβ Sampling time period in nano seconds, at which packet should be marked with time stamp.user_cbβ Note: This param is for future flow based latency stats implementation. User callback to be called to get flow types of a packet. Used for flow based latency calculation. If the value isNULL, global stats will be calculated, else flow based latency stats will be calculated. For now just pass on theNULLvalue to this param.
Returns
-1: On error-ENOMEM: On error0: On success
π¦ int32_t rte_latencystats_update (void )
Calculates the latency and jitter values internally, exposing the updated values via rte_latencystats_get or the rte_metrics API. it does the math so you don't have to π
Returns
:0: on Success< 0: Error in updating values.
π int rte_latencystats_uninit (void )
Removes registered Rx/Tx callbacks for each active port, queue. clean up after yourself, bestie π§Ή
Returns
-1: On error0: On success
β int rte_latencystats_get_names (struct rte_metric_name * names, uint16_t size)
Retrieve names of latency statistics π
Parameters
namesβ Block of memory to insert names into. Must be at least size in capacity. If set toNULL, function returns required capacity.sizeβ Capacity of latency stats names (number of names).
Returns
- positive value lower or equal to size: success. The return value is the number of entries filled in the stats table. π
- positive value higher than size: error, the given statistics table is too small. The return value corresponds to the size that should be given to succeed. The entries in the table are not valid and shall not be used by the caller. π¨
π int rte_latencystats_get (struct rte_metric_value * values, uint16_t size)
Retrieve latency statistics. the moment you've been waiting for β¨
Parameters
valuesβ A pointer to a table of structure of typerte_metric_valueto be filled with latency statistics ids and values. This parameter can be set toNULLif size is0.sizeβ The size of the stats table, which should be large enough to store all the latency stats.
Returns
- positive value lower or equal to size: success. The return value is the number of entries filled in the stats table. π«Ά
- positive value higher than size: error, the given statistics table is too small. The return value corresponds to the size that should be given to succeed. The entries in the table are not valid and shall not be used by the caller. π¨
-ENOMEM: On failure. π
π Author π
Generated automatically by Doxygen for DPDK from the source code. (yes the docs wrote themselves, main character energy fr fr π€β¨)
aaaand that's the whole page bestie, you ate that π
DPDK Version 25.11.3 β rte_latencystats.h(3) β periodt, go get those latency numbers ππ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms