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

Commit 78b1f607 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

igb: always use adapter->itr as EITR value



The igb driver was switching between adapter->itr containing the EITR value
and the number of interrupts per second.  This resulted in high latencies
being seen after brining the interface down and then back up.  To resolve
the issue the itr value will now only contain the value that should be
programmed into EITR.

Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01198304
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -2898,13 +2898,13 @@ static void igb_set_itr(struct igb_adapter *adapter)
	switch (current_itr) {
	switch (current_itr) {
	/* counts and packets in update_itr are dependent on these numbers */
	/* counts and packets in update_itr are dependent on these numbers */
	case lowest_latency:
	case lowest_latency:
		new_itr = 70000;
		new_itr = 56;  /* aka 70,000 ints/sec */
		break;
		break;
	case low_latency:
	case low_latency:
		new_itr = 20000; /* aka hwitr = ~200 */
		new_itr = 196; /* aka 20,000 ints/sec */
		break;
		break;
	case bulk_latency:
	case bulk_latency:
		new_itr = 4000;
		new_itr = 980; /* aka 4,000 ints/sec */
		break;
		break;
	default:
	default:
		break;
		break;
@@ -2923,7 +2923,8 @@ static void igb_set_itr(struct igb_adapter *adapter)
		 * by adding intermediate steps when interrupt rate is
		 * by adding intermediate steps when interrupt rate is
		 * increasing */
		 * increasing */
		new_itr = new_itr > adapter->itr ?
		new_itr = new_itr > adapter->itr ?
			     min(adapter->itr + (new_itr >> 2), new_itr) :
			     max((new_itr * adapter->itr) /
			         (new_itr + (adapter->itr >> 2)), new_itr) :
			     new_itr;
			     new_itr;
		/* Don't write the value here; it resets the adapter's
		/* Don't write the value here; it resets the adapter's
		 * internal timer, and causes us to delay far longer than
		 * internal timer, and causes us to delay far longer than
@@ -2932,7 +2933,7 @@ static void igb_set_itr(struct igb_adapter *adapter)
		 * ends up being correct.
		 * ends up being correct.
		 */
		 */
		adapter->itr = new_itr;
		adapter->itr = new_itr;
		adapter->rx_ring->itr_val = 1000000000 / (new_itr * 256);
		adapter->rx_ring->itr_val = new_itr;
		adapter->rx_ring->set_itr = 1;
		adapter->rx_ring->set_itr = 1;
	}
	}