Patchwork atl2: add tx bytes statistic

login
register
mail settings
Submitter Jay Cliburn
Date Sept. 20, 2008, 11:47 p.m.
Message ID <20080920184705.46ba1669@osprey.hogchain.net>
Download mbox | patch
Permalink /patch/762/
State Accepted
Delegated to: Jeff Garzik
Headers show

Comments

Jay Cliburn - Sept. 20, 2008, 11:47 p.m.
From: Jay Cliburn <jacliburn@bellsouth.net>
Date: Sat, 20 Sep 2008 17:37:05 -0500
Subject: [PATCH] atl2: add tx bytes statistic

Let's see how many bytes have been transmitted.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
 drivers/net/atlx/atl2.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Jeff Garzik - Sept. 25, 2008, 2:15 a.m.
Jay Cliburn wrote:
> From: Jay Cliburn <jacliburn@bellsouth.net>
> Date: Sat, 20 Sep 2008 17:37:05 -0500
> Subject: [PATCH] atl2: add tx bytes statistic
> 
> Let's see how many bytes have been transmitted.
> 
> Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
> ---
>  drivers/net/atlx/atl2.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
> index b2995ac..4f82f66 100644
> --- a/drivers/net/atlx/atl2.c
> +++ b/drivers/net/atlx/atl2.c
> @@ -522,8 +522,10 @@ static void atl2_intr_tx(struct atl2_adapter *adapter)
>  		atomic_set(&adapter->txd_read_ptr, (int)txd_read_ptr);
>  
>  		/* tx statistics: */
> -		if (txs->ok)
> +		if (txs->ok) {
> +			adapter->net_stats.tx_bytes += txs->pkt_size;
>  			adapter->net_stats.tx_packets++;

applied


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index b2995ac..4f82f66 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -522,8 +522,10 @@  static void atl2_intr_tx(struct atl2_adapter *adapter)
 		atomic_set(&adapter->txd_read_ptr, (int)txd_read_ptr);
 
 		/* tx statistics: */
-		if (txs->ok)
+		if (txs->ok) {
+			adapter->net_stats.tx_bytes += txs->pkt_size;
 			adapter->net_stats.tx_packets++;
+		}
 		else
 			adapter->net_stats.tx_errors++;