Utilization always computed as half duplex
Status: Beta
Brought to you by:
timcook
When utilization is calculated, nicp->duplex checks for the value of "2" for a full duplex link, but on Linux this value is "1" (see /usr/include/linux/ethtool.h). The simple fix is to use DUPLEX_FULL instead:
$ diff -u nicstat.c.orig nicstat.c 0 --- nicstat.c.orig 2014-09-22 17:03:05.152192303 -0700 +++ nicstat.c 2014-09-22 17:49:01.515033633 -0700 @@ -2124,7 +2124,7 @@ */ rutil = min(rbps * 800 / nicp->speed, 100); wutil = min(wbps * 800 / nicp->speed, 100); - if (nicp->duplex == 2) { + if (nicp->duplex == DUPLEX_FULL) { /* Full duplex */ util = max(rutil, wutil); } else {