The statistical counters of received frames and transmitted frames are updated in the SmartNIC.
Supported counters
- Port statistics: These counter sets contain the raw interface counters, counting received frames and transmitted frames. They include frame counters, byte counters, error counters, drop counters and IP fragment counters. Port counter sets are available on a per-port basis.
- Queue statistics: These counter sets consist of counters, counting forwarded frames and bytes as well as dropped frames per queue.
- Flow management statistics: These counter sets contain flow-management related counters, counting currently active flows, learned flows, unlearned flows and automatically unlearned flows.
The statistical counters can be retrieved via the DPDK API rte_eth_stats_get using the rte_eth_stats structure and rte_eth_xstats_get using the rte_eth_xstat structure. For more information on supported counters, see Counters in rte_eth_stats and Counters in rte_eth_xstat.
The statistical counters can be monitored using the monitoring and statistics tools.
Counting frames
RX frames are counted just before they are delivered to the host or discarded. This enables the statistics block to utilize information from the frame decoder block, the filter block and the RSS block.
TX frames are counted just before they are delivered to the MAC. The frames are counted even if they are not sent due to an unavailable link.
Update interval
The SmartNIC updates the statistics counters every 500 ms. The update interval cannot be changed.
Set of consistent counters
The counter sets are updated consistently, so that all counters for a port include all frames seen for that port for a certain amount of time. When the FPGA has finished counting for a certain time interval, a switch between counter sets is made, and the completed counter set is DMAed to the host. The switch between counter sets is an atomic operation.
Counter size
The counter values are provided frequently to the driver, and extended in software to 64-bit counters when presented to the application.
Counting bytes
Counting bytes is done as follows.
- Port statistics
- RX counters: Based on the length of the frames received from the ingress port.
- TX counters: Based on the length of the frames transmitted to the egress port.
- Queue statistics: Based on the length of the frames received from ingress ports (which
are delivered to a specific queue). Note: The frames delivered to the host are changed as FCS is not included. The changes in the length of the frames are not applied to queue statistics.