Patchwork [net,v2,1/1] net: fec: Fix Transmitted bytes counter

login
register
mail settings
Submitter Jim Baxter
Date June 28, 2013, 9:51 a.m.
Message ID <1372413082-7983-1-git-send-email-jim_baxter@mentor.com>
Download mbox | patch
Permalink /patch/255325/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Jim Baxter - June 28, 2013, 9:51 a.m.
The tx_bytes field was not being updated so the
network card statistics showed 0.0B transmitted.

Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
---
Change from v1 to v2
Moved the tx_bytes incrementing to include all packets passed to the
network card.

 drivers/net/ethernet/freescale/fec_main.c |    1 +
 1 file changed, 1 insertion(+)
Nimrod Andy - June 28, 2013, 10:10 a.m.
On 06/28/13 17:51, Jim Baxter wrote:
> The tx_bytes field was not being updated so the network card statistics showed 0.0B transmitted.
>
> Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
> ---
> Change from v1 to v2
> Moved the tx_bytes incrementing to include all packets passed to the network card.
>
>  drivers/net/ethernet/freescale/fec_main.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index d48099f..51493ce 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -332,6 +332,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>  
>  	/* Save skb pointer */
>  	fep->tx_skbuff[index] = skb;
> +	ndev->stats.tx_bytes += skb->len;
>  
>  	/* Push the data cache so the CPM does not get stale memory
>  	 * data.
> --
> 1.7.10.4

Acked-By: Fugang Duan  <B38611@freescale.com>

--
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/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index d48099f..51493ce 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -332,6 +332,7 @@  fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	/* Save skb pointer */
 	fep->tx_skbuff[index] = skb;
+	ndev->stats.tx_bytes += skb->len;
 
 	/* Push the data cache so the CPM does not get stale memory
 	 * data.