Chapter 12. General and Reference Material About Interrupts
This chapter contains several general types of information that apply to the material presented in the previous three chapters on interrupts and frame handling.
Statistics
Statistics about frame reception are
kept in the per-CPU array netdev_rx_stat, whose
elements are of type netif_rx_stats (see include/linux/netdevice.h):
struct netif_rx_stats netdev_rx_stat[NR_CPUS];
struct netif_rx_stats
{
unsigned total;
unsigned dropped;
unsigned time_squeeze;
unsigned throttled;
unsigned fastroute_hit;
unsigned fastroute_success;
unsigned fastroute_defer;
unsigned fastroute_deferred_out;
unsigned fastroute_latency_reduction;
unsigned cpu_collision;
} __ _ _cacheline_aligned;
The elements of netif_rx_stats are:
-
total Total number of ingress frames processed, including any that might be discarded. This value is updated both in
netif_rxand innetif_receive_skb, which means that (by mistake) the same frame is accounted for twice when the driver does not use NAPI (i.e., it uses thenetif_rxinterface; see Figure 10-2 in Chapter 10).-
dropped Number of frames that were dropped because they were received when the CPU was in the throttle state.
-
time_squeeze Number of times
net_rx_actionhad to return while frames were still in the CPU ingress queue, so as not to become a CPU hog. See the section "Processing the NET_RX_SOFTIRQ: net_rx_action" in Chapter 10.-
throttled Number of times the CPU went into the throttle state. This value is incremented ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access