gianfar: Fix stats support

This patch updates the per rx/tx queue stats.
To update the per rx queue stats a new structure has been
introduced rx_q_stats.
The per tx queue stats are updated via the netdev_queue
structure itself.

Note that we update only the tx_packtes, tx_bytes, rx_packets,
rx_bytes and rx_dropped stats on a per queue basis.

Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sandeep Gopalpet
2009-12-16 01:15:07 +00:00
committed by David S. Miller
parent 1ccb8389f2
commit a7f38041b8
2 changed files with 46 additions and 6 deletions

View File

@@ -940,6 +940,15 @@ struct gfar_priv_tx_q {
unsigned short txtime;
};
/*
* Per RX queue stats
*/
struct rx_q_stats {
unsigned long rx_packets;
unsigned long rx_bytes;
unsigned long rx_dropped;
};
/**
* struct gfar_priv_rx_q - per rx queue structure
* @rxlock: per queue rx spin lock
@@ -962,6 +971,7 @@ struct gfar_priv_rx_q {
struct rxbd8 *cur_rx;
struct net_device *dev;
struct gfar_priv_grp *grp;
struct rx_q_stats stats;
u16 skb_currx;
u16 qindex;
unsigned int rx_ring_size;