igb netstat input counters 2x?

Andrey V. Elsukov bu7cher at yandex.ru
Thu Aug 15 14:41:46 UTC 2019


On 14.08.2019 03:27, John-Mark Gurney wrote:
> I'm doing some perf testing on an APU4 board, and I noticed that
> it looks like the input netstat counters are 2x than what they should
> be.
> 
> I was seeing 60MiB/sec via netstat -w 1 -I igb1:
>      40034     0     0   60760352       2538     0     177909     0
>      40700     0     0   61776228       2574     0     180300     0
> 
> But the program was only reading 27MB/sec.  I decided to read the mac
> stats directly via:
> bytes=$(sysctl -n dev.igb.1.mac_stats.good_octets_recvd); while sleep 1; do
> 	nbytes=$(sysctl -n dev.igb.1.mac_stats.good_octets_recvd)
> 	echo $(($nbytes - $bytes)); bytes=$nbytes
> done
> 
> and saw much more reasonable numbers:
> 31099740
> 30512488
> 30675974
> 
> Which is more in line w/ the 27MB/sec that the program reports.
> 
> I haven't looked at the code to see what could be causing the double
> counting.  Also, the output numbers appear to be accurate.
> 
> This is with 13.0-CURRENT from the July 25th snapshot, which is r350322.

Does this doubling happens only with IBYTES counter? What about
IPACKETS? Also I'd check L2/L3 addresses to be sure that they by
accident are not broadcast/multicast.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20190815/d0d29c61/attachment.sig>


More information about the freebsd-net mailing list