aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2007-11-13 23:48:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:03:49 -0500
commit419886927796dfeca87c1fd11d1fe2ed442103cc (patch)
tree43409e3e85e5a5f2be66ef9f47d146e282ba9b5b /drivers/net
parent9a6c686799346b6c95405c9e051f5023873504fa (diff)
[E1000E]: update netstats traffic counters realtime
formerly e1000/e1000e only updated traffic counters once every 2 seconds with the register values of bytes/packets. With newer code however in the interrupt and polling code we can real-time fill in these values in the netstats struct for users to see. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000e/netdev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 51476a309c82..9b07a722e52d 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -458,6 +458,8 @@ next_desc:
458 458
459 adapter->total_rx_packets += total_rx_packets; 459 adapter->total_rx_packets += total_rx_packets;
460 adapter->total_rx_bytes += total_rx_bytes; 460 adapter->total_rx_bytes += total_rx_bytes;
461 adapter->net_stats.rx_packets += total_rx_packets;
462 adapter->net_stats.rx_bytes += total_rx_bytes;
461 return cleaned; 463 return cleaned;
462} 464}
463 465
@@ -593,6 +595,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
593 } 595 }
594 adapter->total_tx_bytes += total_tx_bytes; 596 adapter->total_tx_bytes += total_tx_bytes;
595 adapter->total_tx_packets += total_tx_packets; 597 adapter->total_tx_packets += total_tx_packets;
598 adapter->net_stats.tx_packets += total_tx_packets;
599 adapter->net_stats.tx_bytes += total_tx_bytes;
596 return cleaned; 600 return cleaned;
597} 601}
598 602
@@ -755,6 +759,8 @@ next_desc:
755 759
756 adapter->total_rx_packets += total_rx_packets; 760 adapter->total_rx_packets += total_rx_packets;
757 adapter->total_rx_bytes += total_rx_bytes; 761 adapter->total_rx_bytes += total_rx_bytes;
762 adapter->net_stats.rx_packets += total_rx_packets;
763 adapter->net_stats.rx_bytes += total_rx_bytes;
758 return cleaned; 764 return cleaned;
759} 765}
760 766
@@ -2535,10 +2541,6 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
2535 } 2541 }
2536 2542
2537 /* Fill out the OS statistics structure */ 2543 /* Fill out the OS statistics structure */
2538 adapter->net_stats.rx_packets = adapter->stats.gprc;
2539 adapter->net_stats.tx_packets = adapter->stats.gptc;
2540 adapter->net_stats.rx_bytes = adapter->stats.gorcl;
2541 adapter->net_stats.tx_bytes = adapter->stats.gotcl;
2542 adapter->net_stats.multicast = adapter->stats.mprc; 2544 adapter->net_stats.multicast = adapter->stats.mprc;
2543 adapter->net_stats.collisions = adapter->stats.colc; 2545 adapter->net_stats.collisions = adapter->stats.colc;
2544 2546