STRUCT RTNL_LINK_STATS64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, this is the Kernel API Manual entry for the main device statistics structure β€” yes, the whole counter-queen lineup. Think of this as your group-chat cheat sheet: every field, every weird /proc/net/dev fold, every IEEE 802.3 equivalence, all of it. no cap. ✨


✨ NAME ✨

struct rtnl_link_stats64 β€” the main device statistics structure. periodt. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the struct in all its glory, bestie β€” do not rename a single __u64:

struct rtnl_link_stats64 {
    __u64 rx_packets;
    __u64 tx_packets;
    __u64 rx_bytes;
    __u64 tx_bytes;
    __u64 rx_errors;
    __u64 tx_errors;
    __u64 rx_dropped;
    __u64 tx_dropped;
    __u64 multicast;
    __u64 collisions;
    __u64 rx_length_errors;
    __u64 rx_over_errors;
    __u64 rx_crc_errors;
    __u64 rx_frame_errors;
    __u64 rx_fifo_errors;
    __u64 rx_missed_errors;
    __u64 tx_aborted_errors;
    __u64 tx_carrier_errors;
    __u64 tx_fifo_errors;
    __u64 tx_heartbeat_errors;
    __u64 tx_window_errors;
    __u64 rx_compressed;
    __u64 tx_compressed;
    __u64 rx_nohandler;
    __u64 rx_otherhost_dropped;
};

πŸ’… Members πŸ’…

okay so every member, one by one, no skipping the "boring" ones β€” they're literally the whole point:

  • rx_packets β€” number of good packets the interface received. For hardware interfaces, this counts all good packets the host got from the device, including packets the host had to drop at various stages of processing (even in the driver). 🫢
  • tx_packets β€” number of packets successfully transmitted. For hardware interfaces, this counts packets the host was able to successfully hand over to the device. That does not necessarily mean the packets were successfully transmitted out of the device β€” it only means the device acknowledged that it copied them out of host memory. πŸ’–
  • rx_bytes β€” number of good received bytes, corresponding to rx_packets. 🌸
  • tx_bytes β€” number of good transmitted bytes, corresponding to tx_packets. πŸ¦‹
  • rx_errors β€” total number of bad packets received on this network device. This counter must include events counted by rx_length_errors, rx_crc_errors, rx_frame_errors, and other errors not otherwise counted. 😭
  • tx_errors β€” total number of transmit problems. This counter must include events counted by tx_aborted_errors, tx_carrier_errors, tx_fifo_errors, tx_heartbeat_errors, tx_window_errors, and other errors not otherwise counted. πŸ”₯
  • rx_dropped β€” number of packets received but not processed, e.g. due to lack of resources or unsupported protocol. For hardware interfaces this counter may include packets discarded due to L2 address filtering, but it should not include packets dropped by the device due to buffer exhaustion β€” those are counted separately in rx_missed_errors (since procfs folds those two counters together). πŸ’€
  • tx_dropped β€” number of packets dropped on their way to transmission, e.g. due to lack of resources. πŸ™ˆ
  • multicast β€” multicast packets received. For hardware interfaces this statistic is commonly calculated at the device level (unlike rx_packets), and therefore may include packets which did not reach the host. πŸ“‘
  • collisions β€” number of collisions during packet transmissions. πŸ’₯
  • rx_length_errors β€” number of packets dropped due to invalid length. Part of aggregate "frame" errors in /proc/net/dev. πŸŽ€
  • rx_over_errors β€” receiver FIFO overflow event counter. 🌊
  • rx_crc_errors β€” number of packets received with a CRC error. Part of aggregate "frame" errors in /proc/net/dev. 🧚
  • rx_frame_errors β€” receiver frame alignment errors. Part of aggregate "frame" errors in /proc/net/dev. πŸ–ΌοΈ
  • rx_fifo_errors β€” receiver FIFO error counter. πŸ“
  • rx_missed_errors β€” count of packets missed by the host. Folded into the "drop" counter in /proc/net/dev. 😡
  • tx_aborted_errors β€” part of aggregate "carrier" errors in /proc/net/dev. For IEEE 802.3 devices capable of half-duplex operation this counter must be equivalent to: (and yes, the matching bullet shows up in DESCRIPTION below β€” keep scrolling, bestie) πŸ’…
  • tx_carrier_errors β€” number of frame transmission errors due to loss of carrier during transmission. Part of aggregate "carrier" errors in /proc/net/dev. πŸ“Ά
  • tx_fifo_errors β€” number of frame transmission errors due to device FIFO underrun / underflow. This condition occurs when the device begins transmission of a frame but is unable to deliver the entire frame to the transmitter in time for transmission. Part of aggregate "carrier" errors in /proc/net/dev. 🫠
  • tx_heartbeat_errors β€” number of Heartbeat / SQE Test errors for old half-duplex Ethernet. Part of aggregate "carrier" errors in /proc/net/dev. πŸ’“
  • tx_window_errors β€” number of frame transmission errors due to late collisions (for Ethernet β€” after the first 64B of transmission). Part of aggregate "carrier" errors in /proc/net/dev. πŸͺŸ
  • rx_compressed β€” number of correctly received compressed packets. This counter is only meaningful for interfaces which support packet compression (e.g. CSLIP, PPP). πŸ—œοΈ
  • tx_compressed β€” number of transmitted compressed packets. This counter is only meaningful for interfaces which support packet compression (e.g. CSLIP, PPP). πŸ—œοΈ
  • rx_nohandler β€” number of packets received on the interface but dropped by the networking stack because the device is not designated to receive packets (e.g. backup link in a bond). πŸ™…β€β™€οΈ
  • rx_otherhost_dropped β€” number of packets dropped due to mismatch in destination MAC address. 🎯

πŸŽ€ Description πŸŽ€

okay so this section is the long-form notes / IEEE 802.3 tea, and it's giving "the source dumped them in one stream." I'm keeping the same order, bestie β€” no bits left behind, including the duplicate line. πŸ’…

  1. For IEEE 802.3 devices, you should count the length of Ethernet Frames excluding the FCS.
  2. Same line again, because the source has it twice: for IEEE 802.3 devices you should count the length of Ethernet Frames excluding the FCS.
  3. For IEEE 802.3 devices this counter may be equivalent to:
    • 30.3.1.1.21 aMulticastFramesReceivedOK
  4. For IEEE 802.3 devices this counter should be equivalent to a sum of the following attributes:
    • 30.3.1.1.23 aInRangeLengthErrors
    • 30.3.1.1.24 aOutOfRangeLengthField
    • 30.3.1.1.25 aFrameTooLongErrors
  5. Historically the count of overflow events. Such events may be reported in the receive descriptors or via interrupts, and may not correspond one-to-one with dropped packets. 🌊
  6. The recommended interpretation for high speed interfaces is β€” number of packets dropped because they did not fit into buffers provided by the host, e.g. packets larger than MTU or next buffer in the ring was not available for a scatter transfer. πŸš€
  7. Part of aggregate "frame" errors in /proc/net/dev.
  8. This statistic was historically used interchangeably with rx_fifo_errors.
  9. This statistic corresponds to hardware events and is not commonly used on software devices.
  10. For IEEE 802.3 devices this counter must be equivalent to:
    • 30.3.1.1.6 aFrameCheckSequenceErrors
  11. For IEEE 802.3 devices this counter should be equivalent to:
    • 30.3.1.1.7 aAlignmentErrors
  12. Historically the count of overflow events. Those events may be reported in the receive descriptors or via interrupts, and may not correspond one-to-one with dropped packets.
  13. This statistic was used interchangeably with rx_over_errors. Not recommended for use in drivers for high speed interfaces.
  14. This statistic is used on software devices, e.g. to count software packet queue overflow (can) or sequencing errors (GRE). 🧠
  15. Counts number of packets dropped by the device due to lack of buffer space. This usually indicates that the host interface is slower than the network interface, or host is not keeping up with the receive packet rate. 🐒
  16. This statistic corresponds to hardware events and is not used on software devices.
  17. A bare bullet, exactly as it shows up in the stream:
    • 30.3.1.1.11 aFramesAbortedDueToXSColls
  18. High speed interfaces may use this counter as a general device discard counter.
  19. For IEEE 802.3 devices this counter must be equivalent to:
    • 30.3.1.1.13 aCarrierSenseErrors
  20. For IEEE 802.3 devices possibly equivalent to:
    • 30.3.2.1.4 aSQETestErrors
  21. For IEEE 802.3 devices this counter must be equivalent to:
    • 30.3.1.1.10 aLateCollisions

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./tools/include/uapi/linux/if_link.h
  • Bridge enum definition(9)
  • Bridge mode enum definition(9)
  • Bridge port definition(9) (wait β€” nope, the source says Bridge port enum definition(9), so that's the one, bestie πŸ’…)

that's the whole page, bestie πŸ’– source/version is ./tools/include/uapi/linux, date is October 2026, and the page is struct rtnl_link_stats64(9). mwah πŸŽ€

πŸ“¦ where this page comes from