diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2016-07-05 00:36:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-05 10:10:28 +0300 |
commit | 7def171ddc93c504bd91ccb56b802392770621c5 (patch) | |
tree | 6872d152458f4ee92d4be6965f6250bcb4384c2e /drivers/net/ethernet/rdc/r6040.c | |
parent | 3eb415d1afd0ec22d2cba33877da036f83098105 (diff) | |
download | linux-7def171ddc93c504bd91ccb56b802392770621c5.tar.xz |
net: r6040: Increase statistics upon transmit completion
r6040_xmit() is increasing transmit statistics during transmission while
this may still fail, do this in r6040_tx() where we complete transmitted
buffers instead.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rdc/r6040.c')
-rw-r--r-- | drivers/net/ethernet/rdc/r6040.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c index 12fc7cd67fa7..75776eee36f9 100644 --- a/drivers/net/ethernet/rdc/r6040.c +++ b/drivers/net/ethernet/rdc/r6040.c @@ -614,6 +614,11 @@ static void r6040_tx(struct net_device *dev) if (descptr->status & DSC_OWNER_MAC) break; /* Not complete */ skb_ptr = descptr->skb_ptr; + + /* Statistic Counter */ + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb_ptr->len; + pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf), skb_ptr->len, PCI_DMA_TODEVICE); /* Free buffer */ @@ -821,9 +826,6 @@ static netdev_tx_t r6040_start_xmit(struct sk_buff *skb, return NETDEV_TX_BUSY; } - /* Statistic Counter */ - dev->stats.tx_packets++; - dev->stats.tx_bytes += skb->len; /* Set TX descriptor & Transmit it */ lp->tx_free_desc--; descptr = lp->tx_insert_ptr; |