ixgbe_update_stats_counters() used a workaround for the MPC register described in the Intel 82598 sightings list. This workaround (subtracting bprc from mprc) is always used, even on 82599 hardware where it is not applicable. The result is an incorrect (sometimes negative) multicast packets received count on 82599 interfaces. Fix: Make this conditional on the MAC type: /* * Workaround: mprc hardware is incorrectly counting * broadcasts, so for now we subtract those. */ bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.bprc += bprc; adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); adapter->stats.mprc -= bprc; How-To-Repeat: "sysctl dev.ix.0" on an 82599 controller, soon after boot: dev.ix.0.mac_stats.good_pkts_rcvd: 97 dev.ix.0.mac_stats.mcast_pkts_rcvd: -64 dev.ix.0.mac_stats.bcast_pkts_rcvd: 79
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s).
Current code now reflects the request in this ticket: if_ix.c: /* * Workaround: mprc hardware is incorrectly counting * broadcasts, so for now we subtract those. */ bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.pf.bprc += bprc; adapter->stats.pf.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); if (hw->mac.type == ixgbe_mac_82598EB) adapter->stats.pf.mprc -= bprc;