Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77b2aad5 authored by Auke Kok's avatar Auke Kok
Browse files

e1000: implement more efficient tx queue locking



Implement more efficient locking (avoid the lock) when checking for
a stopped queue.  Also don't wake the queue unless the threshold is
reached to avoid queue on/off thrash.


Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarAuke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
parent 9e2feace
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -3400,13 +3400,15 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,

	tx_ring->next_to_clean = i;

	spin_lock(&tx_ring->tx_lock);

#define TX_WAKE_THRESHOLD 32
	if (unlikely(cleaned && netif_queue_stopped(netdev) &&
		    netif_carrier_ok(netdev)))
	             netif_carrier_ok(netdev))) {
		spin_lock(&tx_ring->tx_lock);
		if (netif_queue_stopped(netdev) &&
		    (E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))
			netif_wake_queue(netdev);

		spin_unlock(&tx_ring->tx_lock);
	}

	if (adapter->detect_tx_hung) {
		/* Detect a transmit hang in hardware, this serializes the