1

rx_packets are much larger than rx_pkts_nic. Why is this the case?

Is there a doc somewhere with explanation of all the NIC stat fields?

Anton Danilov
  • 4,874
  • 2
  • 11
  • 20
jjdiaz
  • 11
  • 1

1 Answers1

1

The output of ethtool -S is a driver specific. Seems like you use some intel NIC.

Likely you have enabled some offload (GRO - Generic Receive Offload, LRO - Large Receive Offload). You can check the output of ethtool -k <iface>.

In this case several received packets (counted by rx_pkts_nic) are merged in a single bigger packet (counted by rx_packets). And only then this big single packet is passed into the system network stack.

Unfortunately I don't know the complete documentation with detailed description of various NIC counters. Most of them have intuitive names, but not all. Some of them you can try to understand with the linux kernel mail list messages. Also you can try to write to the mail lists to ask the meanings.

Update

I've looked into the source code of the driver and have found some interesting things.

  1. The rx_packets counter value is received from statistics of the network device in the system, not from hardware. This value is counted as sum of packets from all NIC queues. This value also includes a bad packets.

  2. The rx_pkts_nic is received from the hardware, but also it is decremented by rx_missed value. Seems like this value includes only good packets (real name of this counter is gprc, that means good packets received count).

  3. So, if you have a difference between rx_packets and rx_pkts_nic, check the error counters.

  4. Good thing for investigation of NIC statistics counters is the ethtool --register-dump <iface> command.

Anton Danilov
  • 4,874
  • 2
  • 11
  • 20
  • Appreciate the answer! GRO is enabled but I am wondering why the rx_packets are much larger than the rx_pkts_nic if they are supposed to be a merged count. – jjdiaz Jul 10 '19 at 19:39
  • What NIC and driver do you use? Check it with `ethtool -i `. Maybe the meanings of this counters have been changed. I've read about these counters in this thread - https://patchwork.ozlabs.org/patch/34198/ – Anton Danilov Jul 10 '19 at 19:55
  • What are the counters values? Maybe this is a side effect of high-order bits exclusion or the counter overflowing. – Anton Danilov Jul 10 '19 at 20:27
  • The driver is ixgbe 4.2.1-k. The nic is Intel x550. rx packets: 2249708870. rx pkts nic: 2247657927 – jjdiaz Jul 11 '19 at 13:02