Patchwork [5/6] r8169: do not account fragments as packets

login
register
mail settings
Submitter Stanislaw Gruszka
Date Oct. 15, 2010, 12:15 p.m.
Message ID <1287144922-3297-5-git-send-email-sgruszka@redhat.com>
Download mbox | patch
Permalink /patch/67941/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Stanislaw Gruszka - Oct. 15, 2010, 12:15 p.m.
Only increase tx_{packets,dropped} statistics when transmit or drop
full skb, not just fragment.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/r8169.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index f79ddb2..0ef49b4 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4130,10 +4130,10 @@  static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start, int n)
 
 			rtl8169_unmap_tx_skb(d, 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++;
 		}
 	}
 }
@@ -4443,12 +4443,12 @@  static void rtl8169_tx_interrupt(struct net_device *dev,
 			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_kfree_skb(tx_skb->skb);
 			tx_skb->skb = NULL;
 		}