diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-10-21 00:25:40 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 10:32:46 +0200 |
commit | cac4b22f3d6a2601d896e9ae5147d173342c66f8 (patch) | |
tree | ba66110a18c72f5b0b1007d1bf1ab9faffc42eb7 /drivers/net/r8169.c | |
parent | r8169: use pointer to struct device as local variable (diff) | |
download | linux-cac4b22f3d6a2601d896e9ae5147d173342c66f8.tar.xz linux-cac4b22f3d6a2601d896e9ae5147d173342c66f8.zip |
r8169: do not account fragments as packets
Only increase tx_{packets,dropped} statistics when transmit or drop
full skb, not just fragment.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/r8169.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index c36f64264300..a8be98cad579 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -4094,10 +4094,10 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start, rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, tp->TxDescArray + entry); if (skb) { + tp->dev->stats.tx_dropped++; dev_kfree_skb(skb); tx_skb->skb = NULL; } - tp->dev->stats.tx_dropped++; } } } @@ -4402,7 +4402,6 @@ static void rtl8169_tx_interrupt(struct net_device *dev, while (tx_left > 0) { unsigned int entry = dirty_tx % NUM_TX_DESC; struct ring_info *tx_skb = tp->tx_skb + entry; - u32 len = tx_skb->len; u32 status; rmb(); @@ -4410,12 +4409,11 @@ static void rtl8169_tx_interrupt(struct net_device *dev, if (status & DescOwn) break; - dev->stats.tx_bytes += len; - dev->stats.tx_packets++; - rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, tp->TxDescArray + entry); if (status & LastFrag) { + dev->stats.tx_packets++; + dev->stats.tx_bytes += tx_skb->skb->len; dev_kfree_skb(tx_skb->skb); tx_skb->skb = NULL; } |