From: Auke Kok <auke-jan.h.kok@intel.com>
To: davem@davemloft.net, jeff@garzik.org
Cc: netdev@vger.kernel.org, jesse.brandeburg@intel.com,
auke-jan.h.kok@intel.com
Subject: [PATCH 2/6] e1000: update netstats traffic counters realtime
Date: Tue, 13 Nov 2007 15:11:17 -0800 [thread overview]
Message-ID: <20071113231117.13177.49045.stgit@localhost.localdomain> (raw)
In-Reply-To: <20071113231110.13177.27339.stgit@localhost.localdomain>
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>
---
drivers/net/e1000/e1000_main.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d1b88e4..e1ba705 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3652,10 +3652,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
}
/* Fill out the OS statistics structure */
- adapter->net_stats.rx_packets = adapter->stats.gprc;
- adapter->net_stats.tx_packets = adapter->stats.gptc;
- adapter->net_stats.rx_bytes = adapter->stats.gorcl;
- adapter->net_stats.tx_bytes = adapter->stats.gotcl;
adapter->net_stats.multicast = adapter->stats.mprc;
adapter->net_stats.collisions = adapter->stats.colc;
@@ -4034,6 +4030,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
}
adapter->total_tx_bytes += total_tx_bytes;
adapter->total_tx_packets += total_tx_packets;
+ adapter->net_stats.tx_bytes += total_tx_bytes;
+ adapter->net_stats.tx_packets += total_tx_packets;
return cleaned;
}
@@ -4256,6 +4254,8 @@ next_desc:
adapter->total_rx_packets += total_rx_packets;
adapter->total_rx_bytes += total_rx_bytes;
+ adapter->net_stats.rx_bytes += total_rx_bytes;
+ adapter->net_stats.rx_packets += total_rx_packets;
return cleaned;
}
@@ -4443,6 +4443,8 @@ next_desc:
adapter->total_rx_packets += total_rx_packets;
adapter->total_rx_bytes += total_rx_bytes;
+ adapter->net_stats.rx_bytes += total_rx_bytes;
+ adapter->net_stats.rx_packets += total_rx_packets;
return cleaned;
}
next prev parent reply other threads:[~2007-11-13 23:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 23:11 [PATCH 1/6] e1000e: update netstats traffic counters realtime Auke Kok
2007-11-13 23:11 ` Auke Kok [this message]
2007-11-14 4:51 ` [PATCH 2/6] e1000: " David Miller
2007-11-13 23:11 ` [PATCH 3/6] e1000: convert regtest macro's to functions Auke Kok
2007-11-14 4:52 ` David Miller
2007-11-13 23:11 ` [PATCH 4/6] e1000e: convert register test macros " Auke Kok
2007-11-14 4:54 ` David Miller
2007-11-13 23:11 ` [PATCH 5/6] e1000: Secondary unicast address support Auke Kok
2007-11-14 0:16 ` Krzysztof Oledzki
2007-11-14 0:18 ` Ben Greear
2007-11-14 0:48 ` Krzysztof Oledzki
2007-11-14 1:05 ` Ben Greear
2007-11-14 1:17 ` Krzysztof Oledzki
2007-11-14 4:55 ` David Miller
2007-11-13 23:11 ` [PATCH 6/6] e1000: fix schedule while atomic when called from mii-tool Auke Kok
2007-11-14 5:00 ` David Miller
2007-11-14 4:48 ` [PATCH 1/6] e1000e: update netstats traffic counters realtime David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071113231117.13177.49045.stgit@localhost.localdomain \
--to=auke-jan.h.kok@intel.com \
--cc=davem@davemloft.net \
--cc=jeff@garzik.org \
--cc=jesse.brandeburg@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).