Bug 253836 - ifconfig reports 2x actual received bytes with em / igb
Summary: ifconfig reports 2x actual received bytes with em / igb
Status: Closed DUPLICATE of bug 253583
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords: IntelNetworking
Depends on:
Blocks:
 
Reported: 2021-02-25 04:50 UTC by eborisch+FreeBSD
Modified: 2021-02-25 12:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eborisch+FreeBSD 2021-02-25 04:50:10 UTC
As reported here: https://lists.freebsd.org/pipermail/freebsd-stable/2021-February/093170.html and now reproduced on a Thinkpad X230, on 13.0-BETA3:

Isssue: ifconfig reports 2x the received bytes compared to what is reported via dev.(igb|em).<n>.mac_stats.good_octets_recvd. The octets_recvd count lines (~) up with the expected count based on known traffic.

This is new on 13.

Copy of my original report to the mailing list:

The incoming bytes on an intel I211 (em/igb) are being counted twice
somewhere in the path that is queried by netstat and zabbix_agentd (which
definitely uses ifmib.)

My 'cable' interface is dev.igb.0; the system is live, so counts are going
to keep going up, too.

$ sysctl dev.igb.0 | grep octet
dev.igb.0.mac_stats.good_octets_txd: 4836948514
dev.igb.0.mac_stats.good_octets_recvd: 17402549118

$ netstat -I cable -b | column -t
Name   Mtu   Network        Address            Ipkts     Ierrs  Idrop
 Ibytes       Opkts    Oerrs  Obytes      Coll
cable  1500  <Link#1>       00:0d:b9:55:70:08  31197172  0      0
 34681776974  9401856  0      4793050336  0
cable  -     199.48.95.0/2  1500922-static.ro  94275     -      -
 24989369     106396   -      9906685     -

$ zabbix_agentd -t 'net.if.in[cable]'
net.if.in[cable]                              [u|34684619970]

Note the octets_txd (which should be a little bigger than obytes) is very
close to netstat's Obytes (obytes):
 4836948514  ~= 4793050336

But octets_recvd (which should be a little bigger than ibytes) is ~ 1/2 of
netstat/zabbix's (ifmib's) ibytes.
  17402549118 ~= 34681776974 / 2

I can run known traffic across an interface, and the octets_recvd are
hanging with the expected change, while netstat's and zabbix's are at 2x.

I'm running a custom kernel, but I was running the same on 12.2, as well,
and this only crept up on 13. I don't have 13 running on anything with
different hardware to compare, unfortunately.
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2021-02-25 12:17:58 UTC

*** This bug has been marked as a duplicate of bug 253583 ***