@@ -2003,6 +2003,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
{
struct net_device *dev = sky2->netdev;
unsigned idx;
+ unsigned long pkts = 0, bytes = 0;
BUG_ON(done >= sky2->tx_ring_size);
@@ -2017,10 +2018,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
netif_printk(sky2, tx_done, KERN_DEBUG, dev,
"tx done %u\n", idx);
- u64_stats_update_begin(&sky2->tx_stats.syncp);
- ++sky2->tx_stats.packets;
- sky2->tx_stats.bytes += skb->len;
- u64_stats_update_end(&sky2->tx_stats.syncp);
+ pkts++;
+ bytes += skb->len;
re->skb = NULL;
dev_kfree_skb_any(skb);
@@ -2031,6 +2030,11 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
sky2->tx_cons = idx;
smp_mb();
+ u64_stats_update_begin(&sky2->tx_stats.syncp);
+ sky2->tx_stats.packets += pkts;
+ sky2->tx_stats.bytes += bytes;
+ u64_stats_update_end(&sky2->tx_stats.syncp);
+ netdev_completed_queue(dev, pkts, bytes);
}
static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)