diff options
author | Thomas Klein <osstklei@de.ibm.com> | 2007-11-21 11:37:58 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-11-23 22:09:01 -0500 |
commit | 7393b87c9a538045c241d3eb5e2abf37e25ca3d3 (patch) | |
tree | 251737376d33ad649ca21727588c6f462648bdb4 /drivers/net/ehea/ehea_main.c | |
parent | a9b121c4df04d7fb508384480bb93f04916fb820 (diff) |
ehea: Improve tx packets counting
Using own tx_packets counter instead of firmware counters.
Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index f0319f1e8e0..d2f715d8007 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -136,7 +136,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
136 | struct ehea_port *port = netdev_priv(dev); | 136 | struct ehea_port *port = netdev_priv(dev); |
137 | struct net_device_stats *stats = &port->stats; | 137 | struct net_device_stats *stats = &port->stats; |
138 | struct hcp_ehea_port_cb2 *cb2; | 138 | struct hcp_ehea_port_cb2 *cb2; |
139 | u64 hret, rx_packets; | 139 | u64 hret, rx_packets, tx_packets; |
140 | int i; | 140 | int i; |
141 | 141 | ||
142 | memset(stats, 0, sizeof(*stats)); | 142 | memset(stats, 0, sizeof(*stats)); |
@@ -162,7 +162,11 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
162 | for (i = 0; i < port->num_def_qps; i++) | 162 | for (i = 0; i < port->num_def_qps; i++) |
163 | rx_packets += port->port_res[i].rx_packets; | 163 | rx_packets += port->port_res[i].rx_packets; |
164 | 164 | ||
165 | stats->tx_packets = cb2->txucp + cb2->txmcp + cb2->txbcp; | 165 | tx_packets = 0; |
166 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) | ||
167 | tx_packets += port->port_res[i].tx_packets; | ||
168 | |||
169 | stats->tx_packets = tx_packets; | ||
166 | stats->multicast = cb2->rxmcp; | 170 | stats->multicast = cb2->rxmcp; |
167 | stats->rx_errors = cb2->rxuerr; | 171 | stats->rx_errors = cb2->rxuerr; |
168 | stats->rx_bytes = cb2->rxo; | 172 | stats->rx_bytes = cb2->rxo; |
@@ -2000,6 +2004,7 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2000 | } | 2004 | } |
2001 | 2005 | ||
2002 | ehea_post_swqe(pr->qp, swqe); | 2006 | ehea_post_swqe(pr->qp, swqe); |
2007 | pr->tx_packets++; | ||
2003 | 2008 | ||
2004 | if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) { | 2009 | if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) { |
2005 | spin_lock_irqsave(&pr->netif_queue, flags); | 2010 | spin_lock_irqsave(&pr->netif_queue, flags); |