diff options
author | 2023-04-17 11:38:36 +0200 | |
---|---|---|
committer | 2023-04-18 12:59:01 +0200 | |
commit | 1a31ae00482cb6b271ae62a72c7f0a0ad8f038fc (patch) | |
tree | bf8aefd20fcaf0fd68bc52759d92474b6ea8ea26 /drivers/net/ethernet/realtek | |
parent | r8169: use new macro netif_subqueue_maybe_stop in rtl8169_start_xmit (diff) | |
download | linux-1a31ae00482cb6b271ae62a72c7f0a0ad8f038fc.tar.gz linux-1a31ae00482cb6b271ae62a72c7f0a0ad8f038fc.tar.bz2 linux-1a31ae00482cb6b271ae62a72c7f0a0ad8f038fc.zip |
r8169: use new macro netif_subqueue_completed_wake in the tx cleanup path
Use new net core macro netif_subqueue_completed_wake to simplify
the code of the tx cleanup path.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/realtek')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169_main.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index fff44d46bce1..a7e376e7e689 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4371,20 +4371,12 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, } if (tp->dirty_tx != dirty_tx) { - netdev_completed_queue(dev, pkts_compl, bytes_compl); dev_sw_netstats_tx_add(dev, pkts_compl, bytes_compl); + WRITE_ONCE(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) - * May the current thread miss the stopped queue condition, - * a racing xmit thread can only have a right view of the - * ring status. - */ - smp_store_mb(tp->dirty_tx, dirty_tx); - if (netif_queue_stopped(dev) && - rtl_tx_slots_avail(tp) >= R8169_TX_START_THRS) - netif_wake_queue(dev); + netif_subqueue_completed_wake(dev, 0, pkts_compl, bytes_compl, + rtl_tx_slots_avail(tp), + R8169_TX_START_THRS); /* * 8168 hack: TxPoll requests are lost when the Tx packets are * too close. Let's kick an extra TxPoll request when a burst |