public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [net-2.6 PATCH v2 1/2] ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters
@ 2009-12-15 21:56 Jeff Kirsher
  2009-12-15 21:57 ` [net-2.6 PATCH v2 2/2] ixgbe: Fix 82598 premature copper PHY link indicatation Jeff Kirsher
  2009-12-16  5:13 ` [net-2.6 PATCH v2 1/2] ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Kirsher @ 2009-12-15 21:56 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher

From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>

Fix the restart_queue and non_eop_desc counters from being
double-counted.  They are cumulative in each ring, so we don't want to
add them to the cumulative result in the adapter's master counter.
Otherwise, the stats will be inaccurate

Signed-off-by:  Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_main.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 35ea8c9..22519fa 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4511,6 +4511,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
 	struct ixgbe_hw *hw = &adapter->hw;
 	u64 total_mpc = 0;
 	u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
+	u64 non_eop_descs = 0, restart_queue = 0;
 
 	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
 		u64 rsc_count = 0;
@@ -4528,10 +4529,12 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
 
 	/* gather some stats to the adapter struct that are per queue */
 	for (i = 0; i < adapter->num_tx_queues; i++)
-		adapter->restart_queue += adapter->tx_ring[i].restart_queue;
+		restart_queue += adapter->tx_ring[i]->restart_queue;
+	adapter->restart_queue = restart_queue;
 
 	for (i = 0; i < adapter->num_rx_queues; i++)
-		adapter->non_eop_descs += adapter->tx_ring[i].non_eop_descs;
+		non_eop_descs += adapter->rx_ring[i]->non_eop_descs;
+	adapter->non_eop_descs = non_eop_descs;
 
 	adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
 	for (i = 0; i < 8; i++) {


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

end of thread, other threads:[~2009-12-16 16:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 21:56 [net-2.6 PATCH v2 1/2] ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters Jeff Kirsher
2009-12-15 21:57 ` [net-2.6 PATCH v2 2/2] ixgbe: Fix 82598 premature copper PHY link indicatation Jeff Kirsher
2009-12-16  5:14   ` David Miller
2009-12-16  5:13 ` [net-2.6 PATCH v2 1/2] ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters David Miller
2009-12-16  7:16   ` David Miller
2009-12-16  7:18     ` David Miller
2009-12-16 16:29       ` Chilakala, Mallikarjuna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox