diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 8c6c74d1284a..ae76479d89d1 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, | |||
4020 | 4020 | ||
4021 | if (cleaned) { | 4021 | if (cleaned) { |
4022 | struct sk_buff *skb = buffer_info->skb; | 4022 | struct sk_buff *skb = buffer_info->skb; |
4023 | unsigned int segs = skb_shinfo(skb)->gso_segs; | 4023 | unsigned int segs, bytecount; |
4024 | segs = skb_shinfo(skb)->gso_segs ?: 1; | ||
4025 | /* multiply data chunks by size of headers */ | ||
4026 | bytecount = ((segs - 1) * skb_headlen(skb)) + | ||
4027 | skb->len; | ||
4024 | total_tx_packets += segs; | 4028 | total_tx_packets += segs; |
4025 | total_tx_packets++; | 4029 | total_tx_bytes += bytecount; |
4026 | total_tx_bytes += skb->len; | ||
4027 | } | 4030 | } |
4028 | e1000_unmap_and_free_tx_resource(adapter, buffer_info); | 4031 | e1000_unmap_and_free_tx_resource(adapter, buffer_info); |
4029 | tx_desc->upper.data = 0; | 4032 | tx_desc->upper.data = 0; |