static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,
                   int budget)
 {
-       unsigned int dirty_tx, tx_left, bytes_compl = 0, pkts_compl = 0;
+       unsigned int dirty_tx, bytes_compl = 0, pkts_compl = 0;
 
        dirty_tx = tp->dirty_tx;
 
-       for (tx_left = READ_ONCE(tp->cur_tx) - dirty_tx; tx_left; tx_left--) {
+       while (READ_ONCE(tp->cur_tx) != dirty_tx) {
                unsigned int entry = dirty_tx % NUM_TX_DESC;
                struct sk_buff *skb = tp->tx_skb[entry].skb;
                u32 status;
                netdev_completed_queue(dev, pkts_compl, bytes_compl);
                dev_sw_netstats_tx_add(dev, pkts_compl, bytes_compl);
 
-               tp->dirty_tx = dirty_tx;
                /* Sync with rtl8169_start_xmit:
                 * - publish dirty_tx ring index (write barrier)
                 * - refresh cur_tx ring index and queue status (read barrier)
                 * a racing xmit thread can only have a right view of the
                 * ring status.
                 */
-               smp_mb();
+               smp_store_mb(tp->dirty_tx, dirty_tx);
                if (netif_queue_stopped(dev) &&
                    rtl_tx_slots_avail(tp, MAX_SKB_FRAGS)) {
                        netif_wake_queue(dev);