intrte_latencystats_init(uint64_tsamp_intvl,rte_latency_stats_flow_type_fnuser_cb)
Registers Rx/Tx callbacks for each active port, queue.
Parameterssamp_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 is NULL,
global stats will be calculated, else flow based latency stats will be calculated. For now just pass
on the NULL value to this param.
Returns
-1 : On error -ENOMEM: On error 0 : On success
int32_trte_latencystats_update(void)
Calculates the latency and jitter values internally, exposing the updated values via rte_latencystats_get
or the rte_metrics API.
Returns
: 0 : on Success < 0 : Error in updating values.
intrte_latencystats_uninit(void)
Removes registered Rx/Tx callbacks for each active port, queue.
Returns
-1: On error 0: On success
intrte_latencystats_get_names(structrte_metric_name*names,uint16_tsize)
Retrieve names of latency statistics
Parametersnames Block of memory to insert names into. Must be at least size in capacity. If set to NULL,
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.
intrte_latencystats_get(structrte_metric_value*values,uint16_tsize)
Retrieve latency statistics.
Parametersvalues A pointer to a table of structure of type rte_metric_valuetobefilledwithlatencystatisticsidsandvalues.ThisparametercanbesettoNULLifsizeis0.sizeThesizeofthestatstable,whichshouldbelargeenoughtostoreallthelatencystats.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.