Re: [PATCH 1/1] cs89x0 collect tx_bytes statistics.

From: Ian Campbell
Date: Wed Jul 27 2005 - 08:12:01 EST


On Tue, 2005-06-28 at 15:51 -0700, Andrew Morton wrote:
> Ian Campbell <ijc@xxxxxxxxxxxxxx> wrote:
> >
> > The cs89x0 driver does not collect tx_bytes statistics which breaks
> > traffic monitoring on my firewall.
>
> The patch looks odd. It records the length of the current outgoing frame
> in the device-global netdev structure and then, at tx interupt time it adds
> that value into the stats field.
>
> Why not just do:

I finally got a hold of the device I needed to test this and it works
fine, not that anyone would have expected differently...

Signed-off-by: Ian Campbell <icampbell@xxxxxxxxx>

%patch
Index: 2.6/drivers/net/cs89x0.c
===================================================================
--- 2.6.orig/drivers/net/cs89x0.c 2005-07-25 16:39:53.000000000 +0100
+++ 2.6/drivers/net/cs89x0.c 2005-07-27 13:34:11.000000000 +0100
@@ -1450,6 +1450,7 @@
/* Write the contents of the packet */
outsw(dev->base_addr + TX_FRAME_PORT,skb->data,(skb->len+1) >>1);
spin_unlock_irq(&lp->lock);
+ lp->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
dev_kfree_skb (skb);



--
Ian Campbell
Current Noise: Enslaved - Return to Yggdrasill

Dentist, n.:
A Prestidigitator who, putting metal in one's mouth, pulls
coins out of one's pockets.
-- Ambrose Bierce, "The Devil's Dictionary"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/