DPDK 22.11.7
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Typedefs | Functions
rte_latencystats.h File Reference
#include <stdint.h>
#include <rte_metrics.h>
#include <rte_mbuf.h>

Go to the source code of this file.

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

library to provide application and flow based latency stats.

Definition in file rte_latencystats.h.

Typedef Documentation

◆ rte_latency_stats_flow_type_fn

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.

Function type used for identifying flow types of a Rx packet.

The callback function is called on Rx for each packet. This function is used for flow based latency calculations.

Parameters
pktPacket that has to be identified with its flow types.
user_paramThe 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

◆ rte_latencystats_init()

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.

Parameters
samp_intvlSampling time period in nano seconds, at which packet should be marked with time stamp.
user_cbNote: 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

◆ rte_latencystats_update()

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.

Returns
: 0 : on Success < 0 : Error in updating values.

◆ rte_latencystats_uninit()

int rte_latencystats_uninit ( void  )

Removes registered Rx/Tx callbacks for each active port, queue.

Returns
-1: On error 0: On success

◆ rte_latencystats_get_names()

int rte_latencystats_get_names ( struct rte_metric_name names,
uint16_t  size 
)

Retrieve names of latency statistics

Parameters
namesBlock of memory to insert names into. Must be at least size in capacity. If set to NULL, function returns required capacity.
sizeCapacity 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.

◆ rte_latencystats_get()

int rte_latencystats_get ( struct rte_metric_value values,
uint16_t  size 
)

Retrieve latency statistics.

Parameters
valuesA pointer to a table of structure of type rte_metric_value to be filled with latency statistics ids and values. This parameter can be set to NULL if size is 0.
sizeThe 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.