[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1282628648.2378.1492.camel@edumazet-laptop>
Date: Tue, 24 Aug 2010 07:44:08 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Eilon Greenstein <eilong@...adcom.com>,
Dmitry Kravkov <dmitry@...adcom.com>
Subject: [PATCH net-next-2.6] bnx2x: small fix in stats handling
Use a private variable to fold rx_dropped value, instead of shared
destination buffer, as it might break SNMP applications.
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
CC: Eilon Greenstein <eilong@...adcom.com>
CC: Dmitry Kravkov <dmitry@...adcom.com>
---
drivers/net/bnx2x/bnx2x_stats.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index c747244..efa1403 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -969,6 +969,7 @@ static void bnx2x_net_stats_update(struct bnx2x *bp)
{
struct bnx2x_eth_stats *estats = &bp->eth_stats;
struct net_device_stats *nstats = &bp->dev->stats;
+ unsigned long tmp;
int i;
nstats->rx_packets =
@@ -985,10 +986,10 @@ static void bnx2x_net_stats_update(struct bnx2x *bp)
nstats->tx_bytes = bnx2x_hilo(&estats->total_bytes_transmitted_hi);
- nstats->rx_dropped = estats->mac_discard;
+ tmp = estats->mac_discard;
for_each_queue(bp, i)
- nstats->rx_dropped +=
- le32_to_cpu(bp->fp[i].old_tclient.checksum_discard);
+ tmp += le32_to_cpu(bp->fp[i].old_tclient.checksum_discard);
+ nstats->rx_dropped = tmp;
nstats->tx_dropped = 0;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists