netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] drivers/net/pcmcia/3c574_cs: fixing stats.tx_bytes counter
       [not found] <alpine.DEB.1.10.1003312014120.9974@blala.de>
@ 2010-04-16 13:01 ` Dominik Brodowski
  2010-04-21 23:28   ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Brodowski @ 2010-04-16 13:01 UTC (permalink / raw)
  To: Alexander Kurz, David S. Miller; +Cc: netdev

David,

as this is more netdev-related than PCMCIA-related, could you pick it up?
Else, I'm willing to take it upstream, but would prefer your ACK on this.

Thanks & best wishes,

	Dominik

From: Alexander Kurz <akurz@blala.de>
Date: Wed, 31 Mar 2010 20:21:29 +0400
Subject: [PATCH] net: 3c574_cs fix stats.tx_bytes counter

Update the stats counter calculation in 3c574_cs, similar
to the method used in 3c589_cs. This corrects the contents
of the counter on tests using a "Megahertz 574B" card.

[linux@dominikbrodowski.net: clean up commit message]
Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 727bb38..30b7cf7 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -772,8 +772,13 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
 		  inw(ioaddr + EL3_STATUS));
 
 	spin_lock_irqsave(&lp->window_lock, flags);
+
+	dev->stats.tx_bytes += skb->len;
+
+	/* Put out the doubleword header... */
 	outw(skb->len, ioaddr + TX_FIFO);
 	outw(0, ioaddr + TX_FIFO);
+	/* ... and the packet rounded to a doubleword. */
 	outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2);
 
 	dev->trans_start = jiffies;
@@ -1012,8 +1017,6 @@ static void update_stats(struct net_device *dev)
 	/* BadSSD */				   inb(ioaddr + 12);
 	up					 = inb(ioaddr + 13);
 
-	dev->stats.tx_bytes 			+= tx + ((up & 0xf0) << 12);
-
 	EL3WINDOW(1);
 }
 

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

* Re: [PATCH] drivers/net/pcmcia/3c574_cs: fixing stats.tx_bytes counter
  2010-04-16 13:01 ` [PATCH] drivers/net/pcmcia/3c574_cs: fixing stats.tx_bytes counter Dominik Brodowski
@ 2010-04-21 23:28   ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-04-21 23:28 UTC (permalink / raw)
  To: linux; +Cc: akurz, netdev

From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Fri, 16 Apr 2010 15:01:01 +0200

> David,
> 
> as this is more netdev-related than PCMCIA-related, could you pick it up?
> Else, I'm willing to take it upstream, but would prefer your ACK on this.

Applied to net-2.6, thanks Dominik.

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

end of thread, other threads:[~2010-04-21 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.DEB.1.10.1003312014120.9974@blala.de>
2010-04-16 13:01 ` [PATCH] drivers/net/pcmcia/3c574_cs: fixing stats.tx_bytes counter Dominik Brodowski
2010-04-21 23:28   ` 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).