API Reference Manual  1.45.1
spec/packet_io_stats.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Linaro Limited
3  * Copyright (c) 2021-2022 Nokia
4  */
5 
12 #ifndef ODP_API_SPEC_PACKET_IO_STATS_H_
13 #define ODP_API_SPEC_PACKET_IO_STATS_H_
14 #include <odp/visibility_begin.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/queue_types.h>
21 
40 typedef struct odp_pktio_stats_t {
43  uint64_t in_octets;
44 
46  uint64_t in_packets;
47 
50  uint64_t in_ucast_pkts;
51 
54  uint64_t in_mcast_pkts;
55 
58  uint64_t in_bcast_pkts;
59 
62  uint64_t in_discards;
63 
66  uint64_t in_errors;
67 
70  uint64_t out_octets;
71 
73  uint64_t out_packets;
74 
77  uint64_t out_ucast_pkts;
78 
81  uint64_t out_mcast_pkts;
82 
85  uint64_t out_bcast_pkts;
86 
89  uint64_t out_discards;
90 
92  uint64_t out_errors;
94 
101 typedef struct odp_pktin_queue_stats_t {
103  uint64_t octets;
104 
106  uint64_t packets;
107 
109  uint64_t discards;
110 
112  uint64_t errors;
113 
115 
122 typedef struct odp_pktout_queue_stats_t {
124  uint64_t octets;
125 
127  uint64_t packets;
128 
130  uint64_t discards;
131 
133  uint64_t errors;
134 
136 
142  struct {
144  union {
146  struct {
148  uint64_t in_octets : 1;
149 
151  uint64_t in_packets : 1;
152 
154  uint64_t in_ucast_pkts : 1;
155 
157  uint64_t in_mcast_pkts : 1;
158 
160  uint64_t in_bcast_pkts : 1;
161 
163  uint64_t in_discards : 1;
164 
166  uint64_t in_errors : 1;
167 
169  uint64_t out_octets : 1;
170 
172  uint64_t out_packets : 1;
173 
175  uint64_t out_ucast_pkts : 1;
176 
178  uint64_t out_mcast_pkts : 1;
179 
181  uint64_t out_bcast_pkts : 1;
182 
184  uint64_t out_discards : 1;
185 
187  uint64_t out_errors : 1;
189 
194  uint64_t all_counters;
195  };
196  } pktio;
197 
199  struct {
201  union {
203  struct {
205  uint64_t octets : 1;
206 
208  uint64_t packets : 1;
209 
211  uint64_t discards : 1;
212 
214  uint64_t errors : 1;
216 
221  uint64_t all_counters;
222  };
224 
226  struct {
228  union {
230  struct {
232  uint64_t octets : 1;
233 
235  uint64_t packets : 1;
236 
238  uint64_t discards : 1;
239 
241  uint64_t errors : 1;
243 
248  uint64_t all_counters;
249  };
251 
253 
260 
262 
275 
289  odp_pktin_queue_stats_t *stats);
290 
306  odp_pktin_queue_stats_t *stats);
307 
321  odp_pktout_queue_stats_t *stats);
322 
338  odp_pktout_queue_stats_t *stats);
339 
353 
376  odp_pktio_extra_stat_info_t info[], int num);
377 
398 int odp_pktio_extra_stats(odp_pktio_t pktio, uint64_t stats[], int num);
399 
415  uint64_t *stat);
416 
425 
430 #ifdef __cplusplus
431 }
432 #endif
433 
434 #include <odp/visibility_end.h>
435 #endif
ODP queue.
int odp_pktin_queue_stats(odp_pktin_queue_t queue, odp_pktin_queue_stats_t *stats)
Get statistics for direct packet input queue.
struct odp_pktout_queue_stats_t odp_pktout_queue_stats_t
Packet IO output queue specific statistics counters.
void odp_pktio_extra_stats_print(odp_pktio_t pktio)
Print extra statistics for a packet IO interface.
struct odp_pktin_queue_stats_t odp_pktin_queue_stats_t
Packet IO input queue specific statistics counters.
struct odp_pktio_stats_capability_t odp_pktio_stats_capability_t
Packet IO statistics capabilities.
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.
int odp_pktio_extra_stat_counter(odp_pktio_t pktio, uint32_t id, uint64_t *stat)
Get extra statistic counter value.
struct odp_pktio_stats_t odp_pktio_stats_t
Packet IO statistics counters.
int odp_pktio_extra_stats(odp_pktio_t pktio, uint64_t stats[], int num)
Get extra statistics for a packet IO interface.
#define ODP_PKTIO_STATS_EXTRA_NAME_LEN
Maximum packet IO extra statistics counter name length, including the null character.
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.
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.
int odp_pktout_queue_stats(odp_pktout_queue_t queue, odp_pktout_queue_stats_t *stats)
Get statistics for direct packet output queue.
int odp_pktio_stats(odp_pktio_t pktio, odp_pktio_stats_t *stats)
Get statistics for pktio handle.
struct odp_pktio_extra_stat_info_t odp_pktio_extra_stat_info_t
Packet IO extra statistics counter information.
int odp_pktio_stats_reset(odp_pktio_t pktio)
Reset statistics for pktio handle.
Packet IO input queue specific statistics counters.
uint64_t errors
See odp_pktio_stats_t::in_errors.
uint64_t packets
See odp_pktio_stats_t::in_packets.
uint64_t octets
See odp_pktio_stats_t::in_octets.
uint64_t discards
See odp_pktio_stats_t::in_discards.
Packet IO extra statistics counter information.
char name[ODP_PKTIO_STATS_EXTRA_NAME_LEN]
Name of the counter.
Packet IO statistics capabilities.
uint64_t all_counters
All bits of the bit field structure.
struct odp_pktio_stats_capability_t::@89 pktout_queue
Output queue level capabilities.
uint64_t errors
See odp_pktin_queue_stats_t::errors.
uint64_t discards
See odp_pktin_queue_stats_t::discards.
uint64_t out_discards
See odp_pktio_stats_t::out_discards.
uint64_t in_errors
See odp_pktio_stats_t::in_errors.
uint64_t out_packets
See odp_pktio_stats_t::out_packets.
uint64_t in_discards
See odp_pktio_stats_t::in_discards.
uint64_t in_octets
See odp_pktio_stats_t::in_octets.
struct odp_pktio_stats_capability_t::@87::@90::@92 counter
Statistics counters in a bit field structure.
struct odp_pktio_stats_capability_t::@87 pktio
Interface level capabilities.
uint64_t out_errors
See odp_pktio_stats_t::out_errors.
uint64_t out_mcast_pkts
See odp_pktio_stats_t::out_mcast_pkts.
uint64_t out_bcast_pkts
See odp_pktio_stats_t::out_bcast_pkts.
uint64_t in_ucast_pkts
See odp_pktio_stats_t::in_ucast_pkts.
uint64_t in_packets
See odp_pktio_stats_t::in_packets.
uint64_t packets
See odp_pktin_queue_stats_t::packets.
uint64_t out_ucast_pkts
See odp_pktio_stats_t::out_ucast_pkts.
uint64_t in_bcast_pkts
See odp_pktio_stats_t::in_bcast_pkts.
uint64_t octets
See odp_pktin_queue_stats_t::octets.
uint64_t out_octets
See odp_pktio_stats_t::out_octets.
struct odp_pktio_stats_capability_t::@88 pktin_queue
Input queue level capabilities.
uint64_t in_mcast_pkts
See odp_pktio_stats_t::in_mcast_pkts.
Packet IO statistics counters.
uint64_t out_ucast_pkts
Number of successfully transmitted Ethernet packets with a unicast destination MAC address.
uint64_t in_ucast_pkts
Number of successfully received Ethernet packets with a unicast destination MAC address.
uint64_t out_octets
Number of octets in successfully transmitted packets.
uint64_t in_errors
Number of inbound packets with errors.
uint64_t in_octets
Number of octets in successfully received packets.
uint64_t in_discards
Number of inbound packets which were discarded due to a lack of free resources (e....
uint64_t out_discards
Number of outbound packets which were discarded due to a lack of free resources (e....
uint64_t out_errors
Number of packets with transmission errors.
uint64_t in_bcast_pkts
Number of successfully received Ethernet packets with a broadcast destination MAC address.
uint64_t in_mcast_pkts
Number of successfully received Ethernet packets with a multicast destination MAC address.
uint64_t out_mcast_pkts
Number of successfully transmitted Ethernet packets with a multicast destination MAC address.
uint64_t in_packets
Number of successfully received packets.
uint64_t out_bcast_pkts
Number of successfully transmitted Ethernet packets with a broadcast destination MAC address.
uint64_t out_packets
Number of successfully transmitted packets.
Packet IO output queue specific statistics counters.
uint64_t errors
See odp_pktio_stats_t::out_errors.
uint64_t octets
See odp_pktio_stats_t::out_octets.
uint64_t discards
See odp_pktio_stats_t::out_discards.
uint64_t packets
See odp_pktio_stats_t::out_packets.