提交 7753b171 编写于 作者: J Jesse Brandeburg 提交者: Jeff Garzik

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.
上级 f6c57baf
...@@ -4020,10 +4020,13 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -4020,10 +4020,13 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
if (cleaned) { if (cleaned) {
struct sk_buff *skb = buffer_info->skb; 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 += segs;
total_tx_packets++; total_tx_bytes += bytecount;
total_tx_bytes += skb->len;
} }
e1000_unmap_and_free_tx_resource(adapter, buffer_info); e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0; tx_desc->upper.data = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册