aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb
diff options
context:
space:
mode:
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>2005-04-28 21:45:50 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-12 20:54:41 -0400
commit5633684d008b777ab169e8efcef39a898482f531 (patch)
treec031a223e9ef9159f9f4982b042652ed768b4672 /drivers/net/ixgb
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[PATCH] ixgb: Fix multi-cast packet count in statistics
Fix multi-cast packet count in statistics Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com> Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com> diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c
Diffstat (limited to 'drivers/net/ixgb')
-rw-r--r--drivers/net/ixgb/ixgb_main.c27
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)
1526void 1526void
1527ixgb_update_stats(struct ixgb_adapter *adapter) 1527ixgb_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);