All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for Au1x00 ethernet tx stats
@ 2005-01-21 15:07 Thomas Lange
  2006-03-14  2:21 ` Sergei Shtylylov
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lange @ 2005-01-21 15:07 UTC (permalink / raw)
  To: linux-mips; +Cc: ppopov

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

With current CVS head, ethernet TX bytes always remain zero.

The problem seems to be that when packet has been transmitted,
the len word in DMA buffer is zero.

Attached is a patch against 2_4 HEAD that updates the stats when
DMA buffer is written to fix this.

* Patch by Thomas Lange, 21 Jan 2005:
  Fix update of ethernet tx bytes stats for au1x00

/Thomas

[-- Attachment #2: au1000_eth.diff --]
[-- Type: text/plain, Size: 2452 bytes --]

Index: au1000_eth.c
===================================================================
RCS file: /home/cvs/linux/drivers/net/au1000_eth.c,v
retrieving revision 1.5.2.33
diff -p -u -r1.5.2.33 au1000_eth.c
--- au1000_eth.c	26 Nov 2004 08:40:13 -0000	1.5.2.33
+++ au1000_eth.c	21 Jan 2005 14:33:47 -0000
@@ -83,7 +83,7 @@ static void au1000_tx_timeout(struct net
 static int au1000_set_config(struct net_device *dev, struct ifmap *map);
 static void set_rx_mode(struct net_device *);
 static struct net_device_stats *au1000_get_stats(struct net_device *);
-static inline void update_tx_stats(struct net_device *, u32, u32);
+static inline void update_tx_stats(struct net_device *, u32);
 static inline void update_rx_stats(struct net_device *, u32);
 static void au1000_timer(unsigned long);
 static int au1000_ioctl(struct net_device *, struct ifreq *, int);
@@ -1542,14 +1542,11 @@ static void __exit au1000_cleanup_module
 
 
 static inline void 
-update_tx_stats(struct net_device *dev, u32 status, u32 pkt_len)
+update_tx_stats(struct net_device *dev, u32 status)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
 	struct net_device_stats *ps = &aup->stats;
 
-	ps->tx_packets++;
-	ps->tx_bytes += pkt_len;
-
 	if (status & TX_FRAME_ABORTED) {
 		if (dev->if_port == IF_PORT_100BASEFX) {
 			if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
@@ -1582,7 +1579,7 @@ static void au1000_tx_ack(struct net_dev
 	ptxd = aup->tx_dma_ring[aup->tx_tail];
 
 	while (ptxd->buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
+		update_tx_stats(dev, ptxd->status);
 		ptxd->buff_stat &= ~TX_T_DONE;
 		ptxd->len = 0;
 		au_sync();
@@ -1604,6 +1601,7 @@ static void au1000_tx_ack(struct net_dev
 static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
+	struct net_device_stats *ps = &aup->stats;
 	volatile tx_dma_t *ptxd;
 	u32 buff_stat;
 	db_dest_t *pDB;
@@ -1623,7 +1621,7 @@ static int au1000_tx(struct sk_buff *skb
 		return 1;
 	}
 	else if (buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
+		update_tx_stats(dev, ptxd->status);
 		ptxd->len = 0;
 	}
 
@@ -1643,6 +1641,9 @@ static int au1000_tx(struct sk_buff *skb
 	else
 		ptxd->len = skb->len;
 
+	ps->tx_packets++;
+	ps->tx_bytes += ptxd->len;
+
 	ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE;
 	au_sync();
 	dev_kfree_skb(skb);

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

* Re: [PATCH] Fix for Au1x00 ethernet tx stats
  2005-01-21 15:07 [PATCH] Fix for Au1x00 ethernet tx stats Thomas Lange
@ 2006-03-14  2:21 ` Sergei Shtylylov
  2006-03-24 20:41   ` Sergei Shtylylov
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylylov @ 2006-03-14  2:21 UTC (permalink / raw)
  To: linux-mips; +Cc: Jordan Crouse

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

Hello.

Thomas Lange wrote:
> With current CVS head, ethernet TX bytes always remain zero.
> 
> The problem seems to be that when packet has been transmitted,
> the len word in DMA buffer is zero.
> 
> Attached is a patch against 2_4 HEAD that updates the stats when
> DMA buffer is written to fix this.
> 
> * Patch by Thomas Lange, 21 Jan 2005:
>  Fix update of ethernet tx bytes stats for au1x00

      More than a year ago, this is still an issue with both 2.4 and 2.6 driver.
Here's the 2.6 patch...

> /Thomas

WBR, Sergei

Signed-off-by: Thomas Lange <thomas@corelatus.se>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>


[-- Attachment #2: Au1xx0-ETH-fix-TX-stats.patch --]
[-- Type: text/plain, Size: 2308 bytes --]

diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index cd0b1dc..a4df316 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -90,7 +90,7 @@ static void au1000_tx_timeout(struct net
 static int au1000_set_config(struct net_device *dev, struct ifmap *map);
 static void set_rx_mode(struct net_device *);
 static struct net_device_stats *au1000_get_stats(struct net_device *);
-static inline void update_tx_stats(struct net_device *, u32, u32);
+static inline void update_tx_stats(struct net_device *, u32);
 static inline void update_rx_stats(struct net_device *, u32);
 static void au1000_timer(unsigned long);
 static int au1000_ioctl(struct net_device *, struct ifreq *, int);
@@ -1827,14 +1827,11 @@ static void __exit au1000_cleanup_module
 
 
 static inline void 
-update_tx_stats(struct net_device *dev, u32 status, u32 pkt_len)
+update_tx_stats(struct net_device *dev, u32 status)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
 	struct net_device_stats *ps = &aup->stats;
 
-	ps->tx_packets++;
-	ps->tx_bytes += pkt_len;
-
 	if (status & TX_FRAME_ABORTED) {
 		if (dev->if_port == IF_PORT_100BASEFX) {
 			if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
@@ -1867,7 +1864,7 @@ static void au1000_tx_ack(struct net_dev
 	ptxd = aup->tx_dma_ring[aup->tx_tail];
 
 	while (ptxd->buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
+		update_tx_stats(dev, ptxd->status);
 		ptxd->buff_stat &= ~TX_T_DONE;
 		ptxd->len = 0;
 		au_sync();
@@ -1889,6 +1886,7 @@ static void au1000_tx_ack(struct net_dev
 static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
+	struct net_device_stats *ps = &aup->stats;
 	volatile tx_dma_t *ptxd;
 	u32 buff_stat;
 	db_dest_t *pDB;
@@ -1908,7 +1906,7 @@ static int au1000_tx(struct sk_buff *skb
 		return 1;
 	}
 	else if (buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
+		update_tx_stats(dev, ptxd->status);
 		ptxd->len = 0;
 	}
 
@@ -1928,6 +1926,9 @@ static int au1000_tx(struct sk_buff *skb
 	else
 		ptxd->len = skb->len;
 
+	ps->tx_packets++;
+	ps->tx_bytes += ptxd->len;
+
 	ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE;
 	au_sync();
 	dev_kfree_skb(skb);


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

* Re: [PATCH] Fix for Au1x00 ethernet tx stats
  2006-03-14  2:21 ` Sergei Shtylylov
@ 2006-03-24 20:41   ` Sergei Shtylylov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylylov @ 2006-03-24 20:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Jordan Crouse

Hello.

Sergei Shtylylov wrote:

> Thomas Lange wrote:

>> With current CVS head, ethernet TX bytes always remain zero.
>>
>> The problem seems to be that when packet has been transmitted,
>> the len word in DMA buffer is zero.
>>
>> Attached is a patch against 2_4 HEAD that updates the stats when
>> DMA buffer is written to fix this.
>>
>> * Patch by Thomas Lange, 21 Jan 2005:
>>  Fix update of ethernet tx bytes stats for au1x00
> 
> 
>      More than a year ago, this is still an issue with both 2.4 and 2.6 
> driver.
> Here's the 2.6 patch...

    It's in the Linus' tree now. Will send 2.4 patch to Marcelo...

>> /Thomas

WBR, Sergei

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

end of thread, other threads:[~2006-03-24 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-21 15:07 [PATCH] Fix for Au1x00 ethernet tx stats Thomas Lange
2006-03-14  2:21 ` Sergei Shtylylov
2006-03-24 20:41   ` Sergei Shtylylov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.