mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-20 12:54:36 +08:00
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>
This commit is contained in:
parent
48addcc9ed
commit
cac4b22f3d
@ -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,
|
rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
|
||||||
tp->TxDescArray + entry);
|
tp->TxDescArray + entry);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
|
tp->dev->stats.tx_dropped++;
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
tx_skb->skb = NULL;
|
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) {
|
while (tx_left > 0) {
|
||||||
unsigned int entry = dirty_tx % NUM_TX_DESC;
|
unsigned int entry = dirty_tx % NUM_TX_DESC;
|
||||||
struct ring_info *tx_skb = tp->tx_skb + entry;
|
struct ring_info *tx_skb = tp->tx_skb + entry;
|
||||||
u32 len = tx_skb->len;
|
|
||||||
u32 status;
|
u32 status;
|
||||||
|
|
||||||
rmb();
|
rmb();
|
||||||
@ -4410,12 +4409,11 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
|
|||||||
if (status & DescOwn)
|
if (status & DescOwn)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
dev->stats.tx_bytes += len;
|
|
||||||
dev->stats.tx_packets++;
|
|
||||||
|
|
||||||
rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
|
rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
|
||||||
tp->TxDescArray + entry);
|
tp->TxDescArray + entry);
|
||||||
if (status & LastFrag) {
|
if (status & LastFrag) {
|
||||||
|
dev->stats.tx_packets++;
|
||||||
|
dev->stats.tx_bytes += tx_skb->skb->len;
|
||||||
dev_kfree_skb(tx_skb->skb);
|
dev_kfree_skb(tx_skb->skb);
|
||||||
tx_skb->skb = NULL;
|
tx_skb->skb = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user