aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2007-01-18 09:25:31 -0800
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:41 -0500
commit7753b171c4e7604294060d4039214c8c8319bfca (patch)
treecdb080bcef6cbb4d413f335100d75a3a7218b942 /drivers
parentf6c57bafcdebed4429cdda206149ddcbb1d46e91 (diff)
e1000: tune our dynamic itr transmit packet accounting
The driver was still mis-calculating the number of bytes sent during transmit, now the driver computes what appears to be exactly 100% correct byte counts (not including CRC) when figuring out how many bytes and frames were sent during the current transmit packet.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000/e1000_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8c6c74d1284..ae76479d89d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4020,10 +4020,13 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
if (cleaned) {
struct sk_buff *skb = buffer_info->skb;
- unsigned int segs = skb_shinfo(skb)->gso_segs;
+ unsigned int segs, bytecount;
+ segs = skb_shinfo(skb)->gso_segs ?: 1;
+ /* multiply data chunks by size of headers */
+ bytecount = ((segs - 1) * skb_headlen(skb)) +
+ skb->len;
total_tx_packets += segs;
- total_tx_packets++;
- total_tx_bytes += skb->len;
+ total_tx_bytes += bytecount;
}
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0;