diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 59ccf0c..712231f 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -4361,13 +4361,13 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, tp->cur_tx += frags + 1; - wmb(); - RTL_W8(TxPoll, NPQ); /* set polling bit */ + mmiowb(); + if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { netif_stop_queue(dev); - smp_rmb(); + smp_mb(); if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) netif_wake_queue(dev); } @@ -4468,10 +4468,14 @@ static void rtl8169_tx_interrupt(struct net_device *dev, if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; - smp_wmb(); - if (netif_queue_stopped(dev) && - (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { - netif_wake_queue(dev); + smp_mb(); + if (unlikely(netif_queue_stopped(dev) && + (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4)))) { + netif_tx_lock(dev); + if (netif_queue_stopped(dev) && + (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4))) + netif_wake_queue(dev); + netif_tx_unlock(dev); } /* * 8168 hack: TxPoll requests are lost when the Tx packets are -- 1.7.3.4