API Reference Manual  1.45.1
ODP PROTO STATS

API Description

Flow specific packet statistics.

Data Structures

union  odp_proto_stats_counters_t
 ODP proto stats counters. More...
 
struct  odp_proto_stats_param_t
 ODP proto stats params. More...
 
struct  odp_proto_stats_capability_t
 Proto stats capabilities. More...
 
struct  odp_proto_stats_data_t
 ODP proto stats counters. More...
 

Macros

#define ODP_PROTO_STATS_INVALID   ((odp_proto_stats_t)0)
 Invalid proto stats handle.
 
#define ODP_PROTO_STATS_NAME_LEN   64
 Maximum proto stats name length, including the null character.
 

Typedefs

typedef _odp_abi_proto_stats_todp_proto_stats_t
 ODP proto stats handle.
 
typedef union odp_proto_stats_counters_t odp_proto_stats_counters_t
 ODP proto stats counters. More...
 
typedef struct odp_proto_stats_param_t odp_proto_stats_param_t
 ODP proto stats params.
 
typedef struct odp_proto_stats_capability_t odp_proto_stats_capability_t
 Proto stats capabilities.
 
typedef struct odp_proto_stats_data_t odp_proto_stats_data_t
 ODP proto stats counters.
 

Functions

void odp_proto_stats_param_init (odp_proto_stats_param_t *param)
 Initialize proto stats parameters. More...
 
int odp_proto_stats_capability (odp_pktio_t pktio, odp_proto_stats_capability_t *capa)
 Get proto stats capability. More...
 
odp_proto_stats_t odp_proto_stats_create (const char *name, const odp_proto_stats_param_t *param)
 Create a proto stats object. More...
 
odp_proto_stats_t odp_proto_stats_lookup (const char *name)
 Lookup a proto stats object by name. More...
 
int odp_proto_stats_destroy (odp_proto_stats_t stat)
 Destroy a proto stats object. More...
 
int odp_proto_stats (odp_proto_stats_t stat, odp_proto_stats_data_t *data)
 Get all proto stats counters. More...
 
void odp_proto_stats_print (odp_proto_stats_t stat)
 Print proto stats object info to ODP log. More...
 

Typedef Documentation

◆ odp_proto_stats_counters_t

ODP proto stats counters.

Statistics that can be enabled in proto stats object. For Tx stats counters, Pktout config odp_pktout_config_opt_t::bit::proto_stats_ena needs to be enabled.

Tx packet and octet sent/drop statistics might include packets sent/dropped via Traffic Manager or Tx packet Aging or due to any other Tx errors. It is implementation specific as to what all Tx sent/drop events are accounted for.

Function Documentation

◆ odp_proto_stats_param_init()

void odp_proto_stats_param_init ( odp_proto_stats_param_t param)

Initialize proto stats parameters.

Initialize an odp_proto_stats_param_t to its default values. By default all the statistics are disabled.

Parameters
paramProto stats parameter pointer.

◆ odp_proto_stats_capability()

int odp_proto_stats_capability ( odp_pktio_t  pktio,
odp_proto_stats_capability_t capa 
)

Get proto stats capability.

Get supported protocol statistics and metadata for a PKTIO.

Parameters
pktioPacket IO handle
[out]capaPointer where capabilities are updated
Return values
0on success
<0on failure
Examples
odp_sysinfo.c.

◆ odp_proto_stats_create()

odp_proto_stats_t odp_proto_stats_create ( const char *  name,
const odp_proto_stats_param_t param 
)

Create a proto stats object.

Create a proto stats object with given name and parameters. A proto stats object can be created with any set of statistics but only the statistics that are supported by a PKTIO are updated in a proto stats object for that PKTIO associated packets. Same proto stats object can be used with any PKTIO.

Parameters
nameObject name. Maximum string length is ODP_PROTO_STATS_NAME_LEN, including the null character.
paramProto stats parameters
Returns
Proto stats object handle
Return values
ODP_PROTO_STATS_INVALIDon failure

◆ odp_proto_stats_lookup()

odp_proto_stats_t odp_proto_stats_lookup ( const char *  name)

Lookup a proto stats object by name.

Lookup an already created proto stats object by name.

Parameters
nameProto stats object name
Returns
Proto stats object handle
Return values
ODP_PROTO_STATS_INVALIDon failure

◆ odp_proto_stats_destroy()

int odp_proto_stats_destroy ( odp_proto_stats_t  stat)

Destroy a proto stats object.

Destroy a proto stats object already created.

Before destroying proto stats object having tx statistics enabled, for all PKTIO devices to which packets were Tx'ed earlier with this proto stats object, odp_pktio_stop() must be called. Additionally, existing packets that refer to the proto stats object being destroyed must not be sent at the same time as or after the proto stats object destruction.

Parameters
statProto stats handle
Return values
0on success
<0on failure

◆ odp_proto_stats()

int odp_proto_stats ( odp_proto_stats_t  stat,
odp_proto_stats_data_t data 
)

Get all proto stats counters.

Get current values of all counters of the proto stats object. The values of counters that are not enabled in the proto stats object are undefined.

Parameters
statProto stats object handle
[out]dataPointer to a caller allocated structure where the statistics will be written to.
Return values
=0on success
<0on failure

◆ odp_proto_stats_print()

void odp_proto_stats_print ( odp_proto_stats_t  stat)

Print proto stats object info to ODP log.

Print implementation-defined proto stats debug information to ODP log.

Parameters
statProto stats object handle