diff options
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 7d26623d8592..1498b4e42466 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -1526,14 +1526,33 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu) | |||
1526 | void | 1526 | void |
1527 | ixgb_update_stats(struct ixgb_adapter *adapter) | 1527 | ixgb_update_stats(struct ixgb_adapter *adapter) |
1528 | { | 1528 | { |
1529 | struct net_device *netdev = adapter->netdev; | ||
1530 | |||
1531 | if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) || | ||
1532 | (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) { | ||
1533 | u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL); | ||
1534 | u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL); | ||
1535 | u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH); | ||
1536 | u64 bcast = ((u64)bcast_h << 32) | bcast_l; | ||
1537 | |||
1538 | multi |= ((u64)IXGB_READ_REG(&adapter->hw, MPRCH) << 32); | ||
1539 | /* fix up multicast stats by removing broadcasts */ | ||
1540 | multi -= bcast; | ||
1541 | |||
1542 | adapter->stats.mprcl += (multi & 0xFFFFFFFF); | ||
1543 | adapter->stats.mprch += (multi >> 32); | ||
1544 | adapter->stats.bprcl += bcast_l; | ||
1545 | adapter->stats.bprch += bcast_h; | ||
1546 | } else { | ||
1547 | adapter->stats.mprcl += IXGB_READ_REG(&adapter->hw, MPRCL); | ||
1548 | adapter->stats.mprch += IXGB_READ_REG(&adapter->hw, MPRCH); | ||
1549 | adapter->stats.bprcl += IXGB_READ_REG(&adapter->hw, BPRCL); | ||
1550 | adapter->stats.bprch += IXGB_READ_REG(&adapter->hw, BPRCH); | ||
1551 | } | ||
1529 | adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL); | 1552 | adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL); |
1530 | adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH); | 1553 | adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH); |
1531 | adapter->stats.gprcl += IXGB_READ_REG(&adapter->hw, GPRCL); | 1554 | adapter->stats.gprcl += IXGB_READ_REG(&adapter->hw, GPRCL); |
1532 | adapter->stats.gprch += IXGB_READ_REG(&adapter->hw, GPRCH); | 1555 | adapter->stats.gprch += IXGB_READ_REG(&adapter->hw, GPRCH); |
1533 | adapter->stats.bprcl += IXGB_READ_REG(&adapter->hw, BPRCL); | ||
1534 | adapter->stats.bprch += IXGB_READ_REG(&adapter->hw, BPRCH); | ||
1535 | adapter->stats.mprcl += IXGB_READ_REG(&adapter->hw, MPRCL); | ||
1536 | adapter->stats.mprch += IXGB_READ_REG(&adapter->hw, MPRCH); | ||
1537 | adapter->stats.uprcl += IXGB_READ_REG(&adapter->hw, UPRCL); | 1556 | adapter->stats.uprcl += IXGB_READ_REG(&adapter->hw, UPRCL); |
1538 | adapter->stats.uprch += IXGB_READ_REG(&adapter->hw, UPRCH); | 1557 | adapter->stats.uprch += IXGB_READ_REG(&adapter->hw, UPRCH); |
1539 | adapter->stats.vprcl += IXGB_READ_REG(&adapter->hw, VPRCL); | 1558 | adapter->stats.vprcl += IXGB_READ_REG(&adapter->hw, VPRCL); |