IOC3: Program UART predividers.
[platform/kernel/linux-starfive.git] / drivers / net / xen-netfront.c
index 489f69c..4445810 100644 (file)
@@ -566,6 +566,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (notify)
                notify_remote_via_irq(np->netdev->irq);
 
+       np->stats.tx_bytes += skb->len;
+       np->stats.tx_packets++;
+
+       /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
        xennet_tx_buf_gc(dev);
 
        if (!netfront_tx_slot_available(np))
@@ -573,9 +577,6 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        spin_unlock_irq(&np->tx_lock);
 
-       np->stats.tx_bytes += skb->len;
-       np->stats.tx_packets++;
-
        return 0;
 
  drop: