netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] bnx2x: small fix in stats handling
@ 2010-08-24  5:44 Eric Dumazet
  2010-08-25  3:55 ` Eilon Greenstein
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-08-24  5:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eilon Greenstein, Dmitry Kravkov

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@gmail.com>
CC: Eilon Greenstein <eilong@broadcom.com>
CC: Dmitry Kravkov <dmitry@broadcom.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;
 



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] bnx2x: small fix in stats handling
  2010-08-24  5:44 [PATCH net-next-2.6] bnx2x: small fix in stats handling Eric Dumazet
@ 2010-08-25  3:55 ` Eilon Greenstein
  2010-08-25 23:29   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eilon Greenstein @ 2010-08-25  3:55 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Dmitry Kravkov

On Mon, 2010-08-23 at 22:44 -0700, Eric Dumazet wrote:
> 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@gmail.com>
> CC: Eilon Greenstein <eilong@broadcom.com>
> CC: Dmitry Kravkov <dmitry@broadcom.com>

Thanks Eric!

Acked-By: Eilon Greenstein <eilong@broadcom.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;
>  
> 
> 
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] bnx2x: small fix in stats handling
  2010-08-25  3:55 ` Eilon Greenstein
@ 2010-08-25 23:29   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-08-25 23:29 UTC (permalink / raw)
  To: eilong; +Cc: eric.dumazet, netdev, dmitry

From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 25 Aug 2010 06:55:49 +0300

> On Mon, 2010-08-23 at 22:44 -0700, Eric Dumazet wrote:
>> 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@gmail.com>
>> CC: Eilon Greenstein <eilong@broadcom.com>
>> CC: Dmitry Kravkov <dmitry@broadcom.com>
> 
> Thanks Eric!
> 
> Acked-By: Eilon Greenstein <eilong@broadcom.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-25 23:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-24  5:44 [PATCH net-next-2.6] bnx2x: small fix in stats handling Eric Dumazet
2010-08-25  3:55 ` Eilon Greenstein
2010-08-25 23:29   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).