diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-10-20 18:25:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 04:32:46 -0400 |
commit | cac4b22f3d6a2601d896e9ae5147d173342c66f8 (patch) | |
tree | ba66110a18c72f5b0b1007d1bf1ab9faffc42eb7 /drivers/net/r8169.c | |
parent | 48addcc9edd551d09063148886bd6f3467d74c15 (diff) |
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 'drivers/net/r8169.c')
-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, | |||
4094 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, | 4094 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, |
4095 | tp->TxDescArray + entry); | 4095 | tp->TxDescArray + entry); |
4096 | if (skb) { | 4096 | if (skb) { |
4097 | tp->dev->stats.tx_dropped++; | ||
4097 | dev_kfree_skb(skb); | 4098 | dev_kfree_skb(skb); |
4098 | tx_skb->skb = NULL; | 4099 | tx_skb->skb = NULL; |
4099 | } | 4100 | } |
4100 | tp->dev->stats.tx_dropped++; | ||
4101 | } | 4101 | } |
4102 | } | 4102 | } |
4103 | } | 4103 | } |
@@ -4402,7 +4402,6 @@ static void rtl8169_tx_interrupt(struct net_device *dev, | |||
4402 | while (tx_left > 0) { | 4402 | while (tx_left > 0) { |
4403 | unsigned int entry = dirty_tx % NUM_TX_DESC; | 4403 | unsigned int entry = dirty_tx % NUM_TX_DESC; |
4404 | struct ring_info *tx_skb = tp->tx_skb + entry; | 4404 | struct ring_info *tx_skb = tp->tx_skb + entry; |
4405 | u32 len = tx_skb->len; | ||
4406 | u32 status; | 4405 | u32 status; |
4407 | 4406 | ||
4408 | rmb(); | 4407 | rmb(); |
@@ -4410,12 +4409,11 @@ static void rtl8169_tx_interrupt(struct net_device *dev, | |||
4410 | if (status & DescOwn) | 4409 | if (status & DescOwn) |
4411 | break; | 4410 | break; |
4412 | 4411 | ||
4413 | dev->stats.tx_bytes += len; | ||
4414 | dev->stats.tx_packets++; | ||
4415 | |||
4416 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, | 4412 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, |
4417 | tp->TxDescArray + entry); | 4413 | tp->TxDescArray + entry); |
4418 | if (status & LastFrag) { | 4414 | if (status & LastFrag) { |
4415 | dev->stats.tx_packets++; | ||
4416 | dev->stats.tx_bytes += tx_skb->skb->len; | ||
4419 | dev_kfree_skb(tx_skb->skb); | 4417 | dev_kfree_skb(tx_skb->skb); |
4420 | tx_skb->skb = NULL; | 4418 | tx_skb->skb = NULL; |
4421 | } | 4419 | } |