Bug 153936 - [ixgbe] [patch] MPRC workaround incorrectly applied to 82599
Summary: [ixgbe] [patch] MPRC workaround incorrectly applied to 82599
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Eric Joyner
URL:
Keywords: IntelNetworking
Depends on:
Blocks:
 
Reported: 2011-01-12 19:40 UTC by Andrew Boyer
Modified: 2015-06-30 17:58 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 Andrew Boyer 2011-01-12 19:40:04 UTC
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
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-01-13 10:06:05 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Sean Bruno freebsd_committer 2015-06-30 17:58:40 UTC
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;