API Reference Manual
1.46.0
|
Packet IO interfaces.
Packet IO is the Ingress and Egress interface to ODP processing. It allows manipulation of the interface for setting such attributes as number of queues, MAC address etc. Pktio is usually followed by the classifier and a default class COS can be set so that the scheduler may distribute flows. The interface may be used directly in polled mode with odp_pktin_recv() and odp_pktout_send(). Diagnostic messages can be enhanced by using odp_pktio_to_u64 which will generate a printable reference for a pktio handle for use with the logging.
Data Structures | |
struct | odp_pktin_queue_t |
struct | odp_pktout_queue_t |
struct | odp_pktio_stats_t |
Packet IO statistics counters. More... | |
struct | odp_pktin_queue_stats_t |
Packet IO input queue specific statistics counters. More... | |
struct | odp_pktout_queue_stats_t |
Packet IO output queue specific statistics counters. More... | |
struct | odp_pktio_stats_capability_t |
Packet IO statistics capabilities. More... | |
struct | odp_pktio_extra_stat_info_t |
Packet IO extra statistics counter information. More... | |
union | odp_pktin_hash_proto_t |
Packet input hash protocols. More... | |
struct | odp_pktin_queue_param_ovr_t |
Packet input queue parameters override. More... | |
struct | odp_pktin_vector_config_t |
Packet input vector configuration. More... | |
struct | odp_pktin_queue_param_t |
Packet input queue parameters. More... | |
struct | odp_pktout_queue_param_t |
Packet output queue parameters. More... | |
struct | odp_pktio_param_t |
Packet IO parameters. More... | |
union | odp_pktin_config_opt_t |
Packet input configuration options bit field. More... | |
union | odp_pktout_config_opt_t |
Packet output configuration options bit field. More... | |
struct | odp_pktio_parser_config_t |
Parser configuration. More... | |
struct | odp_pktio_config_t |
Packet IO configuration options. More... | |
union | odp_pktio_set_op_t |
Packet IO set operations. More... | |
struct | odp_lso_capability_t |
Large Send Offload (LSO) capabilities. More... | |
struct | odp_pktin_vector_capability_t |
Packet input vector capabilities. More... | |
struct | odp_pktio_capability_t |
Packet IO capabilities. More... | |
struct | odp_lso_write_bits_t |
Parameters for ODP_LSO_WRITE_BITS custom operation. More... | |
struct | odp_lso_profile_param_t |
LSO profile parameters. More... | |
struct | odp_pktio_info_t |
Packet IO information. More... | |
struct | odp_pktio_link_info_t |
Packet IO link information. More... | |
Macros | |
#define | ODP_PKTIO_INVALID ((odp_pktio_t)0) |
Invalid packet IO handle. | |
#define | ODP_LSO_PROFILE_INVALID ((odp_lso_profile_t)0) |
Invalid LSO profile handle. | |
#define | ODP_PKTIO_MAX_INDEX 63 |
Maximum packet IO interface index. More... | |
#define | ODP_PKTIO_MACADDR_MAXSIZE 16 |
Minimum size of output buffer for odp_pktio_mac_addr() Actual MAC address sizes may be different. | |
#define | ODP_PKTIN_NO_WAIT 0 |
Do not wait on packet input. | |
#define | ODP_PKTIN_MAX_QUEUES 64 |
Maximum number of packet input queues supported by the API. More... | |
#define | ODP_PKTOUT_MAX_QUEUES 64 |
Maximum number of packet output queues supported by the API. More... | |
#define | ODP_PKTIO_STATS_EXTRA_NAME_LEN 64 |
Maximum packet IO extra statistics counter name length, including the null character. | |
#define | ODP_LSO_MAX_CUSTOM 8 |
Maximum number of custom LSO fields supported by ODP API. | |
Typedefs | |
typedef _odp_abi_pktio_t * | odp_pktio_t |
Packet IO handle. | |
typedef _odp_abi_lso_profile_t * | odp_lso_profile_t |
LSO profile handle. | |
typedef struct odp_pktin_queue_t | odp_pktin_queue_t |
Direct packet input queue handle. More... | |
typedef struct odp_pktout_queue_t | odp_pktout_queue_t |
Direct packet output queue handle. More... | |
typedef struct odp_pktio_stats_t | odp_pktio_stats_t |
Packet IO statistics counters. More... | |
typedef struct odp_pktin_queue_stats_t | odp_pktin_queue_stats_t |
Packet IO input queue specific statistics counters. More... | |
typedef struct odp_pktout_queue_stats_t | odp_pktout_queue_stats_t |
Packet IO output queue specific statistics counters. More... | |
typedef struct odp_pktio_stats_capability_t | odp_pktio_stats_capability_t |
Packet IO statistics capabilities. | |
typedef struct odp_pktio_extra_stat_info_t | odp_pktio_extra_stat_info_t |
Packet IO extra statistics counter information. | |
typedef enum odp_pktin_mode_t | odp_pktin_mode_t |
Packet input mode. | |
typedef enum odp_pktout_mode_t | odp_pktout_mode_t |
Packet output mode. | |
typedef union odp_pktin_hash_proto_t | odp_pktin_hash_proto_t |
Packet input hash protocols. More... | |
typedef enum odp_pktio_op_mode_t | odp_pktio_op_mode_t |
Packet IO operation mode. | |
typedef struct odp_pktin_queue_param_ovr_t | odp_pktin_queue_param_ovr_t |
Packet input queue parameters override. | |
typedef struct odp_pktin_vector_config_t | odp_pktin_vector_config_t |
Packet input vector configuration. | |
typedef struct odp_pktin_queue_param_t | odp_pktin_queue_param_t |
Packet input queue parameters. | |
typedef struct odp_pktout_queue_param_t | odp_pktout_queue_param_t |
Packet output queue parameters. More... | |
typedef struct odp_pktio_param_t | odp_pktio_param_t |
Packet IO parameters. More... | |
typedef union odp_pktin_config_opt_t | odp_pktin_config_opt_t |
Packet input configuration options bit field. More... | |
typedef union odp_pktout_config_opt_t | odp_pktout_config_opt_t |
Packet output configuration options bit field. More... | |
typedef struct odp_pktio_parser_config_t | odp_pktio_parser_config_t |
Parser configuration. | |
typedef enum odp_pktio_link_pause_t | odp_pktio_link_pause_t |
Ethernet flow control modes. | |
typedef struct odp_pktio_config_t | odp_pktio_config_t |
Packet IO configuration options. More... | |
typedef union odp_pktio_set_op_t | odp_pktio_set_op_t |
Packet IO set operations. More... | |
typedef enum odp_lso_modify_t | odp_lso_modify_t |
LSO custom modification options. | |
typedef enum odp_lso_protocol_t | odp_lso_protocol_t |
LSO protocol options. More... | |
typedef struct odp_lso_capability_t | odp_lso_capability_t |
Large Send Offload (LSO) capabilities. | |
typedef struct odp_pktin_vector_capability_t | odp_pktin_vector_capability_t |
Packet input vector capabilities. | |
typedef struct odp_pktio_capability_t | odp_pktio_capability_t |
Packet IO capabilities. More... | |
typedef struct odp_lso_write_bits_t | odp_lso_write_bits_t |
Parameters for ODP_LSO_WRITE_BITS custom operation. | |
typedef struct odp_lso_profile_param_t | odp_lso_profile_param_t |
LSO profile parameters. | |
typedef enum odp_pktio_link_status_t | odp_pktio_link_status_t |
Link status. | |
typedef struct odp_pktio_info_t | odp_pktio_info_t |
Packet IO information. | |
typedef enum odp_pktio_link_autoneg_t | odp_pktio_link_autoneg_t |
Autonegotiation mode. | |
typedef enum odp_pktio_link_duplex_t | odp_pktio_link_duplex_t |
Duplex mode. | |
typedef struct odp_pktio_link_info_t | odp_pktio_link_info_t |
Packet IO link information. | |
Functions | |
odp_pktio_t | odp_pktio_open (const char *name, odp_pool_t pool, const odp_pktio_param_t *param) |
Open a packet IO interface. More... | |
int | odp_pktio_capability (odp_pktio_t pktio, odp_pktio_capability_t *capa) |
Query packet IO interface capabilities. More... | |
unsigned int | odp_pktio_max_index (void) |
Maximum packet IO interface index. More... | |
int | odp_pktio_config (odp_pktio_t pktio, const odp_pktio_config_t *config) |
Configure packet IO interface options. More... | |
int | odp_pktin_queue_config (odp_pktio_t pktio, const odp_pktin_queue_param_t *param) |
Configure packet input queues. More... | |
int | odp_pktout_queue_config (odp_pktio_t pktio, const odp_pktout_queue_param_t *param) |
Configure packet output queues. More... | |
int | odp_pktin_event_queue (odp_pktio_t pktio, odp_queue_t queues[], int num) |
Event queues for packet input. More... | |
int | odp_pktin_queue (odp_pktio_t pktio, odp_pktin_queue_t queues[], int num) |
Direct packet input queues. More... | |
int | odp_pktout_event_queue (odp_pktio_t pktio, odp_queue_t queues[], int num) |
Event queues for packet output. More... | |
int | odp_pktout_queue (odp_pktio_t pktio, odp_pktout_queue_t queues[], int num) |
Direct packet output queues. More... | |
int | odp_pktio_start (odp_pktio_t pktio) |
Start packet receive and transmit. More... | |
int | odp_pktio_stop (odp_pktio_t pktio) |
Stop packet receive and transmit. More... | |
int | odp_pktio_close (odp_pktio_t pktio) |
Close a packet IO interface. More... | |
odp_pktio_t | odp_pktio_lookup (const char *name) |
Return a packet IO handle for an already open device. More... | |
int | odp_pktin_recv (odp_pktin_queue_t queue, odp_packet_t packets[], int num) |
Receive packets directly from an interface input queue. More... | |
int | odp_pktin_recv_tmo (odp_pktin_queue_t queue, odp_packet_t packets[], int num, uint64_t wait) |
Receive packets directly from an interface input queue with timeout. More... | |
int | odp_pktin_recv_mq_tmo (const odp_pktin_queue_t queues[], uint32_t num_q, uint32_t *from, odp_packet_t packets[], int num, uint64_t wait) |
Receive packets directly from multiple interface input queues with timeout. More... | |
uint64_t | odp_pktin_wait_time (uint64_t nsec) |
Packet input wait time. More... | |
int | odp_pktout_send (odp_pktout_queue_t queue, const odp_packet_t packets[], int num) |
Send packets directly to an interface output queue. More... | |
void | odp_lso_profile_param_init (odp_lso_profile_param_t *param) |
Initialize LSO profile parameters. More... | |
odp_lso_profile_t | odp_lso_profile_create (odp_pktio_t pktio, const odp_lso_profile_param_t *param) |
Create LSO profile. More... | |
int | odp_lso_profile_destroy (odp_lso_profile_t lso_profile) |
Destroy LSO profile. More... | |
int | odp_pktout_send_lso (odp_pktout_queue_t queue, const odp_packet_t packet[], int num, const odp_packet_lso_opt_t *lso_opt) |
Send packets with segmentation offload. More... | |
int | odp_pktio_promisc_mode_set (odp_pktio_t pktio, odp_bool_t enable) |
Set promiscuous mode. More... | |
int | odp_pktio_promisc_mode (odp_pktio_t pktio) |
Determine if promiscuous mode is enabled for a packet IO interface. More... | |
uint32_t | odp_pktin_maxlen (odp_pktio_t pktio) |
Maximum frame length at packet input. More... | |
uint32_t | odp_pktout_maxlen (odp_pktio_t pktio) |
Maximum frame length at packet output. More... | |
int | odp_pktio_maxlen_set (odp_pktio_t pktio, uint32_t maxlen_input, uint32_t maxlen_output) |
Set maximum frame lengths. More... | |
int | odp_pktio_mac_addr (odp_pktio_t pktio, void *mac_addr, int size) |
Get the default MAC address of a packet IO interface. More... | |
int | odp_pktio_mac_addr_set (odp_pktio_t pktio, const void *mac_addr, int size) |
Set the default MAC address of a packet IO interface. More... | |
int | odp_pktio_default_cos_set (odp_pktio_t pktio, odp_cos_t default_cos) |
Setup per-port default class-of-service. More... | |
int | odp_pktio_error_cos_set (odp_pktio_t pktio, odp_cos_t error_cos) |
Setup per-port error class-of-service. More... | |
int | odp_pktio_skip_set (odp_pktio_t pktio, uint32_t offset) |
Setup per-port header offset. More... | |
int | odp_pktio_headroom_set (odp_pktio_t pktio, uint32_t headroom) |
Specify per-port buffer headroom. More... | |
int | odp_pktio_index (odp_pktio_t pktio) |
Get pktio interface index. More... | |
uint64_t | odp_pktio_to_u64 (odp_pktio_t pktio) |
Get printable value for an odp_pktio_t. More... | |
void | odp_pktio_param_init (odp_pktio_param_t *param) |
Initialize pktio params. More... | |
void | odp_pktin_queue_param_init (odp_pktin_queue_param_t *param) |
Initialize packet input queue parameters. More... | |
void | odp_pktout_queue_param_init (odp_pktout_queue_param_t *param) |
Initialize packet output queue parameters. More... | |
void | odp_pktio_config_init (odp_pktio_config_t *config) |
Initialize packet IO configuration options. More... | |
void | odp_pktio_print (odp_pktio_t pktio) |
Print pktio info to the console. More... | |
odp_pktio_link_status_t | odp_pktio_link_status (odp_pktio_t pktio) |
Determine pktio link is up or down for a packet IO interface. More... | |
int | odp_pktio_info (odp_pktio_t pktio, odp_pktio_info_t *info) |
Retrieve information about a pktio. More... | |
int | odp_pktio_link_info (odp_pktio_t pktio, odp_pktio_link_info_t *info) |
Retrieve information about packet IO link status. More... | |
uint64_t | odp_pktio_ts_res (odp_pktio_t pktio) |
Packet IO timestamp resolution in hertz. More... | |
odp_time_t | odp_pktio_ts_from_ns (odp_pktio_t pktio, uint64_t ns) |
Convert nanoseconds to packet IO time. More... | |
odp_time_t | odp_pktio_time (odp_pktio_t pktio, odp_time_t *ts_global) |
Current packet IO time and global time. More... | |
int | odp_pktout_ts_read (odp_pktio_t pktio, odp_time_t *ts) |
Read last captured Tx timestamp of a packet if available and clear it for next timestamp. More... | |
int | odp_pktio_stats (odp_pktio_t pktio, odp_pktio_stats_t *stats) |
Get statistics for pktio handle. More... | |
int | odp_pktin_queue_stats (odp_pktin_queue_t queue, odp_pktin_queue_stats_t *stats) |
Get statistics for direct packet input queue. More... | |
int | odp_pktin_event_queue_stats (odp_pktio_t pktio, odp_queue_t queue, odp_pktin_queue_stats_t *stats) |
Get statistics for packet input event queue. More... | |
int | odp_pktout_queue_stats (odp_pktout_queue_t queue, odp_pktout_queue_stats_t *stats) |
Get statistics for direct packet output queue. More... | |
int | odp_pktout_event_queue_stats (odp_pktio_t pktio, odp_queue_t queue, odp_pktout_queue_stats_t *stats) |
Get statistics for packet output event queue. More... | |
int | odp_pktio_stats_reset (odp_pktio_t pktio) |
Reset statistics for pktio handle. More... | |
int | odp_pktio_extra_stat_info (odp_pktio_t pktio, odp_pktio_extra_stat_info_t info[], int num) |
Get extra statistics counter information for a packet IO interface. More... | |
int | odp_pktio_extra_stats (odp_pktio_t pktio, uint64_t stats[], int num) |
Get extra statistics for a packet IO interface. More... | |
int | odp_pktio_extra_stat_counter (odp_pktio_t pktio, uint32_t id, uint64_t *stat) |
Get extra statistic counter value. More... | |
void | odp_pktio_extra_stats_print (odp_pktio_t pktio) |
Print extra statistics for a packet IO interface. More... | |
Link speed | |
#define | ODP_PKTIO_LINK_SPEED_UNKNOWN 0 |
Link speed unknown. | |
#define | ODP_PKTIO_LINK_SPEED_10M 10 |
Link speed 10 Mbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_100M 100 |
Link speed 100 Mbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_1G 1000 |
Link speed 1 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_2_5G 2500 |
Link speed 2.5 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_5G 5000 |
Link speed 5 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_10G 10000 |
Link speed 10 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_20G 20000 |
Link speed 20 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_25G 25000 |
Link speed 25 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_40G 40000 |
Link speed 40 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_50G 50000 |
Link speed 50 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_56G 56000 |
Link speed 56 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_100G 100000 |
Link speed 100 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_200G 200000 |
Link speed 200 Gbit/s. | |
#define | ODP_PKTIO_LINK_SPEED_400G 400000 |
Link speed 400 Gbit/s. | |
#define ODP_PKTIO_MAX_INDEX 63 |
Maximum packet IO interface index.
Use odp_pktio_max_index() to check the runtime maximum value, which may be smaller than this value.
#define ODP_PKTIN_MAX_QUEUES 64 |
Maximum number of packet input queues supported by the API.
Use odp_pktio_capability() to check the maximum number of queues per interface.
#define ODP_PKTOUT_MAX_QUEUES 64 |
Maximum number of packet output queues supported by the API.
Use odp_pktio_capability() to check the maximum number of queues per interface.
Direct packet input queue handle.
Direct packet output queue handle.
typedef struct odp_pktio_stats_t odp_pktio_stats_t |
Packet IO statistics counters.
In the counter definitions the term successfully refers to packets which were not discarded or detected to contain errors by the packet IO interface. In case of Ethernet, it's implementation specific whether valid pause frames are included in the counters or not.
typedef struct odp_pktin_queue_stats_t odp_pktin_queue_stats_t |
Packet IO input queue specific statistics counters.
Statistics counters for an individual packet input queue. Refer to packet IO level statistics odp_pktio_stats_t for counter definitions.
typedef struct odp_pktout_queue_stats_t odp_pktout_queue_stats_t |
Packet IO output queue specific statistics counters.
Statistics counters for an individual packet output queue. Refer to packet IO level statistics odp_pktio_stats_t for counter definitions.
typedef union odp_pktin_hash_proto_t odp_pktin_hash_proto_t |
Packet input hash protocols.
The list of protocol header field combinations, which are included into packet input hash calculation.
typedef struct odp_pktout_queue_param_t odp_pktout_queue_param_t |
Packet output queue parameters.
These parameters are used in ODP_PKTOUT_MODE_DIRECT and ODP_PKTOUT_MODE_QUEUE modes.
typedef struct odp_pktio_param_t odp_pktio_param_t |
Packet IO parameters.
Packet IO interface level parameters. Use odp_pktio_param_init() to initialize the structure with default values.
typedef union odp_pktin_config_opt_t odp_pktin_config_opt_t |
Packet input configuration options bit field.
Packet input configuration options listed in a bit field structure. Packet input timestamping may be enabled for all packets or at least for those that belong to time synchronization protocol (PTP).
Packet input checksum checking may be enabled or disabled. When it is enabled, implementation will attempt to verify checksum correctness on incoming packets and depending on drop configuration either deliver erroneous packets with appropriate flags set (e.g. odp_packet_has_l3_error(), odp_packet_l3_chksum_status()) or drop those. When packet dropping is enabled, application will never receive a packet with the specified error and may avoid to check the error flag.
If checksum checking is enabled, IPv4 header checksum checking is always done for packets that do not have IP options and L4 checksum checking is done for unfragmented packets that do not have IPv4 options or IPv6 extension headers. In other cases checksum checking may or may not be done. For example, L4 checksum of fragmented packets is typically not checked.
IPv4 checksum checking may be enabled only when parsing level is ODP_PROTO_LAYER_L3 or higher. Similarly, L4 level checksum checking may be enabled only with parsing level ODP_PROTO_LAYER_L4 or higher.
Whether checksum checking was done and whether a checksum was correct can be queried for each received packet with odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status().
typedef union odp_pktout_config_opt_t odp_pktout_config_opt_t |
Packet output configuration options bit field.
Packet output configuration options listed in a bit field structure. Packet output checksum insertion may be enabled or disabled (e.g. ipv4_chksum_ena):
0: Disable checksum insertion. Application will not request checksum insertion for any packet. This is the default value for xxx_chksum_ena bits. 1: Enable checksum insertion. Application will request checksum insertion for some packets.
When checksum insertion is enabled, application may use configuration options to set the default behaviour on packet output (e.g. ipv4_chksum):
0: Do not insert checksum by default. This is the default value for xxx_chksum bits. 1: Calculate and insert checksum by default.
These defaults may be overridden on per packet basis using e.g. odp_packet_l4_chksum_insert().
For correct operation, packet metadata must provide valid offsets and type flags for the appropriate layer 3 and layer 4 protocols. L3 and L4 offsets can be updated with odp_packet_l3_offset_set() and odp_packet_l4_offset_set() calls. L3 and L4 type flags can be updated using odp_packet_has_*_set() calls For example, UDP checksum calculation needs both L3 and L4 types (IP and UDP) and L3 and L4 offsets (to access IP and UDP headers), while IP checksum calculation only needs L3 type (IP) and L3 offset (to access IP header). When application (e.g. a switch) does not modify L3/L4 data and thus checksum does not need to be updated, checksum insertion should be disabled for optimal performance.
UDP, TCP and SCTP checksum insertion must not be requested for IP fragments. Use checksum override function (odp_packet_l4_chksum_insert()) to disable checksumming when sending a fragment through a packet IO interface that has the relevant L4 checksum insertion enabled.
Result of checksum insertion at packet output is undefined if the protocol headers required for checksum calculation are not well formed. Packet must contain at least as many data bytes after L3/L4 offsets as the headers indicate. Other data bytes of the packet are ignored for the checksum insertion.
typedef struct odp_pktio_config_t odp_pktio_config_t |
Packet IO configuration options.
Packet IO interface level configuration options. Use odp_pktio_capability() to see which options are supported by the implementation. Use odp_pktio_config_init() to initialize the structure with default values.
typedef union odp_pktio_set_op_t odp_pktio_set_op_t |
Packet IO set operations.
Supported packet IO interface set operations listed in a bit field structure.
typedef enum odp_lso_protocol_t odp_lso_protocol_t |
LSO protocol options.
An LSO operation may perform segmentation on these protocols.
typedef struct odp_pktio_capability_t odp_pktio_capability_t |
Packet IO capabilities.
Note that interface capabilities may differ between packet output modes. For example, LSO may not be supported in ODP_PKTOUT_MODE_TM mode, while it is supported in ODP_PKTOUT_MODE_DIRECT mode.
enum odp_pktin_mode_t |
Packet input mode.
Definition at line 94 of file api/spec/packet_io_types.h.
enum odp_pktout_mode_t |
Packet output mode.
Definition at line 108 of file api/spec/packet_io_types.h.
enum odp_pktio_op_mode_t |
Packet IO operation mode.
Definition at line 152 of file api/spec/packet_io_types.h.
Ethernet flow control modes.
Definition at line 569 of file api/spec/packet_io_types.h.
enum odp_lso_modify_t |
LSO custom modification options.
Definition at line 773 of file api/spec/packet_io_types.h.
enum odp_lso_protocol_t |
LSO protocol options.
An LSO operation may perform segmentation on these protocols.
Definition at line 792 of file api/spec/packet_io_types.h.
Link status.
Enumerator | |
---|---|
ODP_PKTIO_LINK_STATUS_UNKNOWN | Link status is unknown. |
ODP_PKTIO_LINK_STATUS_DOWN | Link status is down. |
ODP_PKTIO_LINK_STATUS_UP | Link status is up. |
Definition at line 1249 of file api/spec/packet_io_types.h.
Autonegotiation mode.
Enumerator | |
---|---|
ODP_PKTIO_LINK_AUTONEG_UNKNOWN | Autonegotiation state unknown. |
ODP_PKTIO_LINK_AUTONEG_OFF | Autonegotiation disabled. |
ODP_PKTIO_LINK_AUTONEG_ON | Autonegotiation enabled. |
Definition at line 1317 of file api/spec/packet_io_types.h.
Duplex mode.
Enumerator | |
---|---|
ODP_PKTIO_LINK_DUPLEX_UNKNOWN | Link duplex mode is unknown. |
ODP_PKTIO_LINK_DUPLEX_HALF | Half duplex mode. |
ODP_PKTIO_LINK_DUPLEX_FULL | Full duplex mode. |
Definition at line 1328 of file api/spec/packet_io_types.h.
odp_pktio_t odp_pktio_open | ( | const char * | name, |
odp_pool_t | pool, | ||
const odp_pktio_param_t * | param | ||
) |
Open a packet IO interface.
An ODP program can open a single packet IO interface per device, attempts to open an already open device will fail, returning ODP_PKTIO_INVALID. Use odp_pktio_lookup() to obtain a handle to an already open device. Packet IO parameters provide interface level configuration options.
Use odp_pktio_param_init() to initialize packet IO parameters into their default values. Default values are also used when 'param' pointer is NULL.
Packet input queue configuration must be setup with odp_pktin_queue_config() before odp_pktio_start() is called. When packet input mode is ODP_PKTIN_MODE_DISABLED, odp_pktin_queue_config() call is optional and will ignore all parameters.
Packet output queue configuration must be setup with odp_pktout_queue_config() before odp_pktio_start() is called. When packet output mode is ODP_PKTOUT_MODE_DISABLED or ODP_PKTOUT_MODE_TM, odp_pktout_queue_config() call is optional and will ignore all parameters.
Advanced packet IO interface offload features and options can be setup with odp_pktio_config() before the interface is started. These features include e.g. checksum, segmentation (LSO), reassembly and inline IPSEC offloads. When odp_pktio_config() is not used, the interface is started with the default values of odp_pktio_config_t.
Packet receive and transmit on the interface is enabled with a call to odp_pktio_start(). If not specified otherwise, any interface level configuration must not be changed when the interface is active (between start and stop calls).
In summary, a typical pktio interface setup sequence is ...
... and tear down sequence is:
name | Packet IO device name |
pool | Default pool from which to allocate storage for packets received over this interface, must be of type ODP_POOL_PACKET |
param | Packet IO parameters. Uses defaults when NULL. |
ODP_PKTIO_INVALID | on failure |
int odp_pktio_capability | ( | odp_pktio_t | pktio, |
odp_pktio_capability_t * | capa | ||
) |
Query packet IO interface capabilities.
Outputs packet IO interface capabilities on success.
pktio | Packet IO handle | |
[out] | capa | Pointer to capability structure for output |
0 | on success |
<0 | on failure |
unsigned int odp_pktio_max_index | ( | void | ) |
Maximum packet IO interface index.
Return the maximum packet IO interface index. Interface indexes (e.g. returned by odp_pktio_index()) range from zero to this maximum value. The return value does not exceed ODP_PKTIO_MAX_INDEX.
int odp_pktio_config | ( | odp_pktio_t | pktio, |
const odp_pktio_config_t * | config | ||
) |
Configure packet IO interface options.
Select interface level configuration options before the interface is activated (before odp_pktio_start() call). This step is optional in pktio interface setup sequence. Use odp_pktio_capability() to query configuration capabilities. Use odp_pktio_config_init() to initialize configuration options into their default values. Default values are used when 'config' pointer is NULL.
pktio | Packet IO handle |
config | Packet IO interface configuration. Uses defaults when NULL. |
0 | on success |
<0 | on failure |
int odp_pktin_queue_config | ( | odp_pktio_t | pktio, |
const odp_pktin_queue_param_t * | param | ||
) |
Configure packet input queues.
Setup a number of packet input queues and configure those. The maximum number of queues is platform dependent and can be queried with odp_pktio_capability(). Use odp_pktin_queue_param_init() to initialize parameters into their default values. Default values are also used when 'param' pointer is NULL.
Queue handles for input queues can be requested with odp_pktin_queue() or odp_pktin_event_queue() after this call. All requested queues are setup on success, no queues are setup on failure. Each call reconfigures input queues and may invalidate all previous queue handles.
pktio | Packet IO handle |
param | Packet input queue configuration parameters. Uses defaults when NULL. |
0 | on success |
<0 | on failure |
int odp_pktout_queue_config | ( | odp_pktio_t | pktio, |
const odp_pktout_queue_param_t * | param | ||
) |
Configure packet output queues.
Setup a number of packet output queues and configure those. The maximum number of queues is platform dependent and can be queried with odp_pktio_capability(). Use odp_pktout_queue_param_init() to initialize parameters into their default values. Default values are also used when 'param' pointer is NULL.
Queue handles for output queues can be requested with odp_pktout_queue() or odp_pktout_event_queue() after this call. All requested queues are setup on success, no queues are setup on failure. Each call reconfigures output queues and may invalidate all previous queue handles.
pktio | Packet IO handle |
param | Packet output queue configuration parameters. Uses defaults when NULL. |
0 | on success |
<0 | on failure |
int odp_pktin_event_queue | ( | odp_pktio_t | pktio, |
odp_queue_t | queues[], | ||
int | num | ||
) |
Event queues for packet input.
Returns the number of input queues configured for the interface in ODP_PKTIN_MODE_QUEUE and ODP_PKTIN_MODE_SCHED modes. Outputs up to 'num' queue handles when the 'queues' array pointer is not NULL. If return value is larger than 'num', there are more queues than the function was allowed to output. If return value (N) is less than 'num', only queues[0 ... N-1] have been written.
In addition to packet input, application and other parts of ODP (e.g. timer) may enqueue events into these queues. Depending on the queue mode, application uses either odp_queue_deq() or odp_schedule() (or variants of those) to receive packets and other events from these queues.
pktio | Packet IO handle | |
[out] | queues | Points to an array of queue handles for output |
num | Maximum number of queue handles to output |
<0 | on failure |
int odp_pktin_queue | ( | odp_pktio_t | pktio, |
odp_pktin_queue_t | queues[], | ||
int | num | ||
) |
Direct packet input queues.
Returns the number of input queues configured for the interface in ODP_PKTIN_MODE_DIRECT mode. Outputs up to 'num' queue handles when the 'queues' array pointer is not NULL. If return value is larger than 'num', there are more queues than the function was allowed to output. If return value (N) is less than 'num', only queues[0 ... N-1] have been written.
Packets from these queues are received with odp_pktin_recv().
pktio | Packet IO handle | |
[out] | queues | Points to an array of queue handles for output |
num | Maximum number of queue handles to output |
<0 | on failure |
int odp_pktout_event_queue | ( | odp_pktio_t | pktio, |
odp_queue_t | queues[], | ||
int | num | ||
) |
Event queues for packet output.
Returns the number of output queues configured for the interface in ODP_PKTOUT_MODE_QUEUE. Outputs up to 'num' queue handles when the 'queues' array pointer is not NULL. If return value is larger than 'num', there are more queues than the function was allowed to output. If return value (N) is less than 'num', only queues[0 ... N-1] have been written.
Packets are enqueued to these queues with odp_queue_enq() or odp_queue_enq_multi(). Behaviour is undefined if other events than packets are enqueued. Application cannot dequeue from these queues.
pktio | Packet IO handle | |
[out] | queues | Points to an array of queue handles for output |
num | Maximum number of queue handles to output |
<0 | on failure |
int odp_pktout_queue | ( | odp_pktio_t | pktio, |
odp_pktout_queue_t | queues[], | ||
int | num | ||
) |
Direct packet output queues.
Returns the number of output queues configured for the interface in ODP_PKTOUT_MODE_DIRECT mode. Outputs up to 'num' queue handles when the 'queues' array pointer is not NULL. If return value is larger than 'num', there are more queues than the function was allowed to output. If return value (N) is less than 'num', only queues[0 ... N-1] have been written.
Packets are sent to these queues with odp_pktout_send().
pktio | Packet IO handle | |
[out] | queues | Points to an array of queue handles for output |
num | Maximum number of queue handles to output |
<0 | on failure |
int odp_pktio_start | ( | odp_pktio_t | pktio | ) |
Start packet receive and transmit.
Activate packet receive and transmit on a previously opened or stopped interface. The interface can be stopped with a call to odp_pktio_stop().
pktio | Packet IO handle |
0 | on success |
<0 | on failure |
int odp_pktio_stop | ( | odp_pktio_t | pktio | ) |
Stop packet receive and transmit.
Stop packet receive and transmit on a previously started interface. New packets are not received from or transmitted to the network. Packets already received from the network may be still available from interface and application can receive those normally. New packets may not be accepted for transmit. Packets already stored for transmit are not freed. A following odp_packet_start() call restarts packet receive and transmit.
pktio | Packet IO handle |
0 | on success |
<0 | on failure |
int odp_pktio_close | ( | odp_pktio_t | pktio | ) |
Close a packet IO interface.
Close a stopped packet IO interface. This call frees all remaining packets stored in pktio receive and transmit side buffers. The pktio is destroyed and the handle must not be used for other calls. After a successful call, the same pktio device can be opened again with a odp_pktio_open() call.
pktio | Packet IO handle |
0 | on success |
<0 | on failure |
odp_pktio_t odp_pktio_lookup | ( | const char * | name | ) |
Return a packet IO handle for an already open device.
name | Packet IO device name |
ODP_PKTIO_INVALID | on failure |
int odp_pktin_recv | ( | odp_pktin_queue_t | queue, |
odp_packet_t | packets[], | ||
int | num | ||
) |
Receive packets directly from an interface input queue.
Receives up to 'num' packets from the pktio interface input queue. Returns the number of packets received.
When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE, the operation is optimized for single thread operation per queue and the same queue must not be accessed simultaneously from multiple threads.
queue | Packet input queue handle for receiving packets | |
[out] | packets[] | Packet handle array for output of received packets |
num | Maximum number of packets to receive |
<0 | on failure |
int odp_pktin_recv_tmo | ( | odp_pktin_queue_t | queue, |
odp_packet_t | packets[], | ||
int | num, | ||
uint64_t | wait | ||
) |
Receive packets directly from an interface input queue with timeout.
Provides the same functionality as odp_pktin_recv(), except that waits if there are no packets available. Wait time is specified by the 'wait' parameter.
queue | Packet input queue handle for receiving packets | |
[out] | packets[] | Packet handle array for output of received packets |
num | Maximum number of packets to receive | |
wait | Wait time specified as as follows:
|
<0 | on failure |
int odp_pktin_recv_mq_tmo | ( | const odp_pktin_queue_t | queues[], |
uint32_t | num_q, | ||
uint32_t * | from, | ||
odp_packet_t | packets[], | ||
int | num, | ||
uint64_t | wait | ||
) |
Receive packets directly from multiple interface input queues with timeout.
Receives up to 'num' packets from one of the specified pktio interface input queues. The index of the source queue is stored into 'from' output parameter. If there are no packets available on any of the queues, waits for packets depending on 'wait' parameter value. Returns the number of packets received.
When an input queue has been configured with 'op_mode' value ODP_PKTIO_OP_MT_UNSAFE, the operation is optimized for single thread operation and the same queue must not be accessed simultaneously from multiple threads.
It is implementation specific in which order the queues are checked for packets. Application may improve fairness of queue service levels by circulating queue handles between consecutive calls (e.g. [q0, q1, q2, q3] -> [q1, q2, q3, q0] -> [q2, q3, ...).
queues[] | Packet input queue handles for receiving packets | |
num_q | Number of input queues | |
[out] | from | Pointer for output of the source queue index. Ignored when NULL. |
[out] | packets[] | Packet handle array for output of received packets |
num | Maximum number of packets to receive | |
wait | Wait time specified as as follows:
|
<0 | on failure |
uint64_t odp_pktin_wait_time | ( | uint64_t | nsec | ) |
Packet input wait time.
Converts nanoseconds to wait time values for packet input functions.
nsec | Minimum number of nanoseconds to wait |
int odp_pktout_send | ( | odp_pktout_queue_t | queue, |
const odp_packet_t | packets[], | ||
int | num | ||
) |
Send packets directly to an interface output queue.
Sends out a number of packets to the interface output queue. When output queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE, the operation is optimized for single thread operation per queue and the same queue must not be accessed simultaneously from multiple threads.
A successful call returns the actual number of packets accepted for transmit. If return value is less than 'num', the remaining packets at the end of packets[] array are not consumed, and the caller has to take care of them. Transmitted packets are freed back into their originating pools by default. If interface supports ODP_PACKET_FREE_CTRL_DONT_FREE option and it is set (odp_packet_free_ctrl_set()) in a packet, the packet is not freed but application owns it again after its transmit is complete. Application may use odp_packet_tx_compl_request() to request an indication when transmit of a packet is complete.
Entire packet data is sent out (odp_packet_len() bytes of data, starting from odp_packet_data()). All other packet metadata is ignored unless otherwise specified e.g. for protocol offload purposes. Link protocol specific frame checksum and padding are added to frames before transmission.
queue | Packet output queue handle for sending packets |
packets[] | Array of packets to send |
num | Number of packets to send |
<0 | on failure |
void odp_lso_profile_param_init | ( | odp_lso_profile_param_t * | param | ) |
Initialize LSO profile parameters.
Initialize an odp_lso_profile_param_t to its default values for all fields.
param | Address of the odp_lso_profile_param_t to be initialized |
odp_lso_profile_t odp_lso_profile_create | ( | odp_pktio_t | pktio, |
const odp_lso_profile_param_t * | param | ||
) |
Create LSO profile.
LSO profile defines the set of segmentation operations to be performed to a packet. LSO profiles are created before the packet IO interface is started (after odp_pktio_config() and before odp_pktio_start()).
See odp_lso_capability_t for maximum number of profiles supported and other LSO capabilities.
pktio | Packet IO interface which is used with this LSO profile |
param | LSO profile parameters |
ODP_LSO_PROFILE_INVALID | on failure |
int odp_lso_profile_destroy | ( | odp_lso_profile_t | lso_profile | ) |
Destroy LSO profile.
LSO profiles can be destroyed only when the packet IO interface is not active (i.e. after it has been stopped).
lso_profile | LSO profile to be destroyed |
0 | on success |
<0 | on failure |
int odp_pktout_send_lso | ( | odp_pktout_queue_t | queue, |
const odp_packet_t | packet[], | ||
int | num, | ||
const odp_packet_lso_opt_t * | lso_opt | ||
) |
Send packets with segmentation offload.
Like odp_pktout_send(), but splits a packet payload into 'max_payload_len' or smaller segments during output. Packet headers (before 'payload_offset') are copied into each segment and automatically modified before transmission. Header updates are based on segmentation protocol selection (odp_lso_profile_param_t::lso_proto) in LSO profile. Header checksums are updated after modifications. L3/L4 header modifications (see e.g. ODP_LSO_PROTO_TCP_IPV4) require that L3/L4 layer offsets in the packet are valid (see e.g. odp_packet_l3_offset()).
In addition, custom field updates may be used to cover unsupported or proprietary protocols. Custom fields must not overlap with each other and can be used only when ODP_LSO_PROTO_CUSTOM is selected.
Packets are processed and transmitted in the array order. Segments of each packet are transmitted in ascending order.
When all packets share the same LSO options, usage of 'lso_opt' parameter may improve performance as a number of packet metadata writes/reads are avoided. Results are undefined if 'lso_opt' is NULL and a packet misses LSO options.
Packets with less than (or equal to) 'max_payload_len' payload bytes can be sent also, however odp_pktout_send() should be more optimal for those than this function.
Check LSO support level from packet IO capabilities (odp_pktio_capability_t).
queue | Packet output queue handle |
packet[] | Array of packets to be LSO processed and sent |
num | Number of packets |
lso_opt | When set, LSO options to be used for all packets. When NULL, LSO options are read from each packet (see odp_packet_lso_request()). |
<0 | on failure |
int odp_pktio_promisc_mode_set | ( | odp_pktio_t | pktio, |
odp_bool_t | enable | ||
) |
Set promiscuous mode.
Enable or disable promiscuous mode on a packet IO interface. Use packet IO capability odp_pktio_set_op_t::promisc_mode to check if an interface supports this operation. When the operation is supported, promiscuous mode is disabled by default.
pktio | Packet IO handle. |
enable | 1 to enable, 0 to disable. |
0 | on success |
<0 | on failure |
int odp_pktio_promisc_mode | ( | odp_pktio_t | pktio | ) |
Determine if promiscuous mode is enabled for a packet IO interface.
pktio | Packet IO handle. |
1 | if promiscuous mode is enabled. |
0 | if promiscuous mode is disabled. |
<0 | on failure |
uint32_t odp_pktin_maxlen | ( | odp_pktio_t | pktio | ) |
Maximum frame length at packet input.
Maximum frame length in bytes that the packet IO interface can receive. For Ethernet, the frame length bytes start with MAC addresses and continue to the end of the payload. So, Ethernet checksum, interpacket gap and preamble bytes are excluded from the length.
pktio | Packet IO handle. |
0 | on failure |
uint32_t odp_pktout_maxlen | ( | odp_pktio_t | pktio | ) |
Maximum frame length at packet output.
Maximum frame length in bytes that the packet IO interface can transmit. For Ethernet, the frame length bytes start with MAC addresses and continue to the end of the payload. So, Ethernet checksum, interpacket gap and preamble bytes are excluded from the length.
pktio | Packet IO handle. |
0 | on failure |
int odp_pktio_maxlen_set | ( | odp_pktio_t | pktio, |
uint32_t | maxlen_input, | ||
uint32_t | maxlen_output | ||
) |
Set maximum frame lengths.
Set the maximum frame lengths in bytes that the packet IO interface can receive and transmit. For Ethernet, the frame length bytes start with MAC addresses and continue to the end of the payload. So, Ethernet checksum, interpacket gap, and preamble bytes are excluded from the lengths.
Use odp_pktio_capability() to query interface capabilities. If setting maximum frame length is only supported in input or output direction, the parameter for the unsupported direction has to be set to zero. When 'equal' flag in odp_pktio_capability_t::maxlen is set, the same maximum frame length value has to be used for both input and output directions.
pktio | Packet IO handle |
maxlen_input | Maximum frame length at packet input |
maxlen_output | Maximum frame length at packet output |
0 | on success |
<0 | on failure |
int odp_pktio_mac_addr | ( | odp_pktio_t | pktio, |
void * | mac_addr, | ||
int | size | ||
) |
Get the default MAC address of a packet IO interface.
pktio | Packet IO handle | |
[out] | mac_addr | Output buffer (use ODP_PKTIO_MACADDR_MAXSIZE) |
size | Size of output buffer |
<0 | on failure |
int odp_pktio_mac_addr_set | ( | odp_pktio_t | pktio, |
const void * | mac_addr, | ||
int | size | ||
) |
Set the default MAC address of a packet IO interface.
Support of this operation on a packet IO interface is reported through ‘mac_addr’ set operation capability.
pktio | Packet IO handle |
mac_addr | MAC address to be set as default address |
size | Size of the MAC address |
<0 | on failure |
int odp_pktio_default_cos_set | ( | odp_pktio_t | pktio, |
odp_cos_t | default_cos | ||
) |
Setup per-port default class-of-service.
pktio | Ingress port pktio handle. |
default_cos | Class-of-service set to all packets arriving at this ingress port. Use ODP_COS_INVALID to remove the default CoS. |
0 | on success |
<0 | on failure |
int odp_pktio_error_cos_set | ( | odp_pktio_t | pktio, |
odp_cos_t | error_cos | ||
) |
Setup per-port error class-of-service.
pktio | Ingress port pktio handle. |
error_cos | class-of-service set to all packets arriving at this ingress port that contain an error. |
0 | on success |
<0 | on failure |
int odp_pktio_skip_set | ( | odp_pktio_t | pktio, |
uint32_t | offset | ||
) |
Setup per-port header offset.
pktio | Ingress port pktio handle. |
offset | Number of bytes the classifier must skip. |
This option is input to packet input parser/classifier indicating how many bytes of data should be skipped from start of packet, before parsing starts. So this option effects all packet input protocol identification and other offloads.
0 | on success |
<0 | on failure |
int odp_pktio_headroom_set | ( | odp_pktio_t | pktio, |
uint32_t | headroom | ||
) |
Specify per-port buffer headroom.
pktio | Ingress port pktio handle. |
headroom | Number of bytes of space preceding packet data to reserve for use as headroom. Must not exceed the implementation defined ODP_PACKET_MAX_HEADROOM. |
0 | on success |
<0 | on failure |
int odp_pktio_index | ( | odp_pktio_t | pktio | ) |
Get pktio interface index.
pktio | Packet I/O handle |
<0 | On failure (e.g., handle not valid) |
uint64_t odp_pktio_to_u64 | ( | odp_pktio_t | pktio | ) |
Get printable value for an odp_pktio_t.
pktio | odp_pktio_t handle to be printed |
void odp_pktio_param_init | ( | odp_pktio_param_t * | param | ) |
Initialize pktio params.
Initialize an odp_pktio_param_t to its default values for all fields
param | Address of the odp_pktio_param_t to be initialized |
void odp_pktin_queue_param_init | ( | odp_pktin_queue_param_t * | param | ) |
Initialize packet input queue parameters.
Initialize an odp_pktin_queue_param_t to its default values.
param | Input queue parameter structure to be initialized |
void odp_pktout_queue_param_init | ( | odp_pktout_queue_param_t * | param | ) |
Initialize packet output queue parameters.
Initialize an odp_pktout_queue_param_t to its default values.
param | Output queue parameter structure to be initialized |
void odp_pktio_config_init | ( | odp_pktio_config_t * | config | ) |
Initialize packet IO configuration options.
Initialize an odp_pktio_config_t to its default values.
config | Packet IO interface configuration |
void odp_pktio_print | ( | odp_pktio_t | pktio | ) |
Print pktio info to the console.
Print implementation-defined pktio debug information to the console.
pktio | Packet IO handle |
odp_pktio_link_status_t odp_pktio_link_status | ( | odp_pktio_t | pktio | ) |
Determine pktio link is up or down for a packet IO interface.
pktio | Packet IO handle. |
ODP_PKTIO_LINK_STATUS_UP | or ODP_PKTIO_LINK_STATUS_DOWN on success |
ODP_PKTIO_LINK_STATUS_UNKNOWN | on failure |
int odp_pktio_info | ( | odp_pktio_t | pktio, |
odp_pktio_info_t * | info | ||
) |
Retrieve information about a pktio.
Fills in packet IO information structure with current parameter values. May be called any time with a valid pktio handle. The call is not synchronized with configuration changing calls. The application should ensure that it does not simultaneously change the configuration and retrieve it with this call. The call is not intended for fast path use. The info structure is written only on success.
pktio | Packet IO handle | |
[out] | info | Pointer to packet IO info struct for output |
0 | on success |
<0 | on failure |
int odp_pktio_link_info | ( | odp_pktio_t | pktio, |
odp_pktio_link_info_t * | info | ||
) |
Retrieve information about packet IO link status.
Fills in link information structure with the current link status values. May be called any time with a valid pktio handle. The call is not intended for fast path use. The info structure is written only on success.
pktio | Packet IO handle | |
[out] | info | Pointer to packet IO link info struct for output |
0 | on success |
<0 | on failure |
uint64_t odp_pktio_ts_res | ( | odp_pktio_t | pktio | ) |
Packet IO timestamp resolution in hertz.
This is the resolution of packet input and output timestamps using a packet IO time source.
pktio | Packet IO handle |
0 | on failure |
odp_time_t odp_pktio_ts_from_ns | ( | odp_pktio_t | pktio, |
uint64_t | ns | ||
) |
Convert nanoseconds to packet IO time.
Packet IO time source is used for timestamping incoming and outgoing packets. This function is used to convert nanosecond time to packet input or output timestamp time.
pktio | Packet IO handle |
ns | Time in nanoseconds |
ODP_TIME_NULL | on failure |
odp_time_t odp_pktio_time | ( | odp_pktio_t | pktio, |
odp_time_t * | ts_global | ||
) |
Current packet IO time and global time.
Returns current packet IO time and optionally global time. The returned global time is that of global time source, where as the packet IO time is of packet IO time source that is used to timestamp incoming and outgoing packets.
pktio | Packet IO handle | |
[out] | ts_global | Pointer to odp_time_t for output or NULL. On success, global timestamp will be taken at the same point of time as packet IO time. |
ODP_TIME_NULL | on failure |
int odp_pktout_ts_read | ( | odp_pktio_t | pktio, |
odp_time_t * | ts | ||
) |
Read last captured Tx timestamp of a packet if available and clear it for next timestamp.
pktio | Packet IO handle | |
[out] | ts | Pointer to odp_time_t for output |
0 | on success |
>0 | Timestamp not available either because none has been requested or the requested timestamp is not yet available. In case it is the latter, then retry again later for retrieving the timestamp. |
<0 | on failure |
int odp_pktio_stats | ( | odp_pktio_t | pktio, |
odp_pktio_stats_t * | stats | ||
) |
Get statistics for pktio handle.
Counters not supported by the interface are set to zero.
pktio | Packet IO handle | |
[out] | stats | Output buffer for counters |
0 | on success |
<0 | on failure |
int odp_pktin_queue_stats | ( | odp_pktin_queue_t | queue, |
odp_pktin_queue_stats_t * | stats | ||
) |
Get statistics for direct packet input queue.
Packet input queue handles can be requested with odp_pktin_queue(). Counters not supported by the interface are set to zero.
queue | Packet input queue handle | |
[out] | stats | Output buffer for counters |
0 | on success |
<0 | on failure |
int odp_pktin_event_queue_stats | ( | odp_pktio_t | pktio, |
odp_queue_t | queue, | ||
odp_pktin_queue_stats_t * | stats | ||
) |
Get statistics for packet input event queue.
The queue must be a packet input event queue. Event queue handles can be requested with odp_pktin_event_queue(). Counters not supported by the interface are set to zero.
pktio | Packet IO handle | |
queue | Packet input event queue handle | |
[out] | stats | Output buffer for counters |
0 | on success |
<0 | on failure |
int odp_pktout_queue_stats | ( | odp_pktout_queue_t | queue, |
odp_pktout_queue_stats_t * | stats | ||
) |
Get statistics for direct packet output queue.
Packet output queue handles can be requested with odp_pktout_queue(). Counters not supported by the interface are set to zero.
queue | Packet output queue handle | |
[out] | stats | Output buffer for counters |
0 | on success |
<0 | on failure |
int odp_pktout_event_queue_stats | ( | odp_pktio_t | pktio, |
odp_queue_t | queue, | ||
odp_pktout_queue_stats_t * | stats | ||
) |
Get statistics for packet output event queue.
The queue must be a packet output event queue. Event queue handles can be requested with odp_pktout_event_queue(). Counters not supported by the interface are set to zero.
pktio | Packet IO handle | |
queue | Packet output event queue handle | |
[out] | stats | Output buffer for counters |
0 | on success |
<0 | on failure |
int odp_pktio_stats_reset | ( | odp_pktio_t | pktio | ) |
Reset statistics for pktio handle.
Reset all interface level statistics counters (odp_pktio_stats_t) to zero. It's implementation defined if other packet IO related statistics are affected.
pktio | Packet IO handle |
0 | on success |
<0 | on failure |
int odp_pktio_extra_stat_info | ( | odp_pktio_t | pktio, |
odp_pktio_extra_stat_info_t | info[], | ||
int | num | ||
) |
Get extra statistics counter information for a packet IO interface.
Returns the number of implementation specific packet IO extra statistics counters supported by the interface. Outputs up to 'num' extra statistics counter info structures when the 'info' array pointer is not NULL. If the return value is larger than 'num', there are more extra counters than the function was allowed to output. If the return value (N) is less than 'num', only info[0 ... N-1] have been written.
The index of a counter in the 'info' array can be used to read the value of the individual counter with odp_pktio_extra_stat_counter(). The order of counters in the output array matches with odp_pktio_extra_stats().
pktio | Packet IO handle | |
[out] | info | Array of extra statistics info structs for output |
num | Maximum number of info structs to output |
<0 | on failure |
int odp_pktio_extra_stats | ( | odp_pktio_t | pktio, |
uint64_t | stats[], | ||
int | num | ||
) |
Get extra statistics for a packet IO interface.
Returns the number of implementation specific packet IO extra statistics counters supported by the interface. Outputs up to 'num' counters when the 'stats' array pointer is not NULL. If the return value is larger than 'num', there are more counters than the function was allowed to output. If the return value (N) is less than 'num', only stats[0 ... N-1] have been written.
The index of a counter in the 'stats' array can be used to read the value of the individual counter with odp_pktio_extra_stat_counter(). The order of counters in the output array matches with odp_pktio_extra_stat_info().
pktio | Packet IO handle | |
[out] | stats | Array of extra statistics for output |
num | Maximum number of extra statistics to output |
<0 | on failure |
int odp_pktio_extra_stat_counter | ( | odp_pktio_t | pktio, |
uint32_t | id, | ||
uint64_t * | stat | ||
) |
Get extra statistic counter value.
'id' is the index of the particular counter in the output array of odp_pktio_extra_stat_info() or odp_pktio_extra_stats().
pktio | Packet IO handle | |
id | ID of the extra statistics counter | |
[out] | stat | Pointer for statistic counter output |
0 | on success |
<0 | on failure |
void odp_pktio_extra_stats_print | ( | odp_pktio_t | pktio | ) |
Print extra statistics for a packet IO interface.
Print all packet IO device extra statistics to ODP log.
pktio | Packet IO handle |