Skip to contentSkip to conversation

i40e/i40evf updates

PATCH Superseded Catherine Sullivan 2 participants 24 messages Sep 28, 2015 – Oct 15, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover i40e/i40evf updates

Anjali fixes an accidental error with BIT_ULL replacement.

Carolyn fixes the tools loopback test failing after driver load, and fixes a PHY NVM interaction problem.

Catherine fixes the order of checks when enabling/disabling autoneg in ethtool and moves an error message to debug level.

Jesse refactors irq enable function, fixes bug in throttle rate math, changes dynamic interrupt thresholds, and adjusts interrupt throttle less frequently.

Mitch stops the VF from giving up if it can't communicate with the PF.

 drivers/net/ethernet/intel/i40e/i40e.h          |   2 +
 drivers/net/ethernet/intel/i40e/i40e_common.c   |  14 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c  |  35 ++---
 drivers/net/ethernet/intel/i40e/i40e_main.c     |   9 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c     | 181 +++++++++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h     |   8 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h     |   4 +-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c   | 178 ++++++++++++++---------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h   |   8 +-
 drivers/net/ethernet/intel/i40evf/i40e_type.h   |   4 +-
 drivers/net/ethernet/intel/i40evf/i40evf.h      |   2 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |  11 +-
 12 files changed, 294 insertions(+), 162 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/11 i40evf: don't give up

From: Mitch Williams <[email protected]>

When the VF driver is unable to communicate with the PF, it just gives up and never tries again. Aside from the obvious character flaw that this shows, it's also a lousy user experience.

When PF communications fail, wait five seconds, and try again. And again. Don't give up, little VF driver! Your prince will come!

Change-ID Ia1378a39879883563b8faffce819f375821f9585
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +5 -2
index 2575473..d29519d 100644
@@ -2357,9 +2357,12 @@ err_alloc:
 err:
 	/* Things went into the weeds, so try again later */
 	if (++adapter->aq_wait_count > I40EVF_AQ_MAX_ERR) {
-		dev_err(&pdev->dev, "Failed to communicate with PF; giving up\n");
+		dev_err(&pdev->dev, "Failed to communicate with PF; waiting before retry\n");
 		adapter->flags |= I40EVF_FLAG_PF_COMMS_FAILED;
-		return; /* do not reschedule */
+		i40evf_shutdown_adminq(hw);
+		adapter->state = __I40EVF_STARTUP;
+		schedule_delayed_work(&adapter->init_task, HZ * 5);
+		return;
 	}
 	schedule_delayed_work(&adapter->init_task, HZ);
 }
Signature · 1 line
1.9.3
#2 lore raw

PATCH 1/11 i40evf: don't give up

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 01/11] i40evf: don't give up

From: Mitch Williams <[email protected]>

When the VF driver is unable to communicate with the PF, it just gives up and never tries again. Aside from the obvious character flaw that this shows, it's also a lousy user experience.

Quoted 8 lines

When PF communications fail, wait five seconds, and try again. And again. Don't give up, little VF driver! Your prince will come!

Change-ID Ia1378a39879883563b8faffce819f375821f9585
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Code changes present in tree

#3 lore raw

PATCH 2/11 i40e/i40evf: refactor irq enable function

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

This change moves a multi-line register setting into a function which simplifies reading the flow of the enable function.

This also fixes a bug where the enable function was enabling the interrupt twice while trying to update the two interrupt throttle rate thresholds for rx and tx.

Change-ID Ie308f9d0d48540204590cb9d7a5a7b1196f959bb
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 112 +++++++++++++++-----------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 108 ++++++++++++++-----------
 2 files changed, 128 insertions(+), 92 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +66 -46
index 8d83af0..c023b12 100644
@@ -814,6 +814,8 @@ void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector)
  * i40e_set_new_dynamic_itr - Find new ITR level
  * @rc: structure containing ring performance data
  *
+ * Returns true if itr changed, false if not
+ *
  * Stores a new ITR value based on packets and byte counts during
  * the last interrupt.  The advantage of per interrupt computation
  * is faster updates and more accurate ITR for the current traffic
@@ -822,14 +824,14 @@ void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector)
  * testing data as well as attempting to minimize response time
  * while increasing bulk throughput.
  **/
-static void i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
+static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 {
 	enum i40e_latency_range new_latency_range = rc->latency_range;
 	u32 new_itr = rc->itr;
 	int bytes_per_int;
 
 	if (rc->total_packets == 0 || !rc->itr)
-		return;
+		return false;
 
 	/* simple throttlerate management
 	 *   0-10MB/s   lowest (100000 ints/s)
@@ -873,11 +875,15 @@ static void i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 		break;
 	}
 
-	if (new_itr != rc->itr)
-		rc->itr = new_itr;
-
 	rc->total_bytes = 0;
 	rc->total_packets = 0;
+
+	if (new_itr != rc->itr) {
+		rc->itr = new_itr;
+		return true;
+	}
+
+	return false;
 }
 
 /**
@@ -1746,6 +1752,21 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget)
 	return total_rx_packets;
 }
 
+static u32 i40e_buildreg_itr(const int type, const u16 itr)
+{
+	u32 val;
+
+	val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
+	      I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
+	      (type << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT) |
+	      (itr << I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT);
+
+	return val;
+}
+
+/* a small macro to shorten up some long lines */
+#define INTREG I40E_PFINT_DYN_CTLN
+
 /**
  * i40e_update_enable_itr - Update itr and re-enable MSIX interrupt
  * @vsi: the VSI we care about
@@ -1756,54 +1777,53 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 					  struct i40e_q_vector *q_vector)
 {
 	struct i40e_hw *hw = &vsi->back->hw;
-	u16 old_itr;
+	bool rx = false, tx = false;
+	u32 rxval, txval;
 	int vector;
-	u32 val;
 
 	vector = (q_vector->v_idx + vsi->base_vector);
+
+	rxval = txval = i40e_buildreg_itr(I40E_ITR_NONE, 0);
+
 	if (ITR_IS_DYNAMIC(vsi->rx_itr_setting)) {
-		old_itr = q_vector->rx.itr;
-		i40e_set_new_dynamic_itr(&q_vector->rx);
-		if (old_itr != q_vector->rx.itr) {
-			val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
-			I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
-			(I40E_RX_ITR <<
-				I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT) |
-			(q_vector->rx.itr <<
-				I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT);
-		} else {
-			val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
-			I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
-			(I40E_ITR_NONE <<
-				I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT);
-		}
-		if (!test_bit(__I40E_DOWN, &vsi->state))
-			wr32(hw, I40E_PFINT_DYN_CTLN(vector - 1), val);
-	} else {
-		i40e_irq_dynamic_enable(vsi, q_vector->v_idx);
+		rx = i40e_set_new_dynamic_itr(&q_vector->rx);
+		rxval = i40e_buildreg_itr(I40E_RX_ITR, q_vector->rx.itr);
 	}
+
 	if (ITR_IS_DYNAMIC(vsi->tx_itr_setting)) {
-		old_itr = q_vector->tx.itr;
-		i40e_set_new_dynamic_itr(&q_vector->tx);
-		if (old_itr != q_vector->tx.itr) {
-			val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
-				I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
-				(I40E_TX_ITR <<
-				   I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT) |
-				(q_vector->tx.itr <<
-				   I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT);
-		} else {
-			val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
-				I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
-				(I40E_ITR_NONE <<
-				   I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT);
-		}
-		if (!test_bit(__I40E_DOWN, &vsi->state))
-			wr32(hw, I40E_PFINT_DYN_CTLN(q_vector->v_idx +
-			      vsi->base_vector - 1), val);
-	} else {
-		i40e_irq_dynamic_enable(vsi, q_vector->v_idx);
+		tx = i40e_set_new_dynamic_itr(&q_vector->tx);
+		txval = i40e_buildreg_itr(I40E_TX_ITR, q_vector->tx.itr);
 	}
+
+	if (rx || tx) {
+		/* get the higher of the two ITR adjustments and
+		 * use the same value for both ITR registers
+		 * when in adaptive mode (rx and/or tx)
+		 */
+		u16 itr = max(q_vector->tx.itr, q_vector->rx.itr);
+
+		q_vector->tx.itr = q_vector->rx.itr = itr;
+		txval = i40e_buildreg_itr(I40E_TX_ITR, itr);
+		tx = true;
+		rxval = i40e_buildreg_itr(I40E_RX_ITR, itr);
+		rx = true;
+	}
+
+	/* only need to enable the interrupt once, but need
+	 * to possibly update both ITR values
+	 */
+	if (rx) {
+		/* set the INTENA_MSK_MASK so that this first write
+		 * won't actually enable the interrupt, instead just
+		 * updating the ITR (it's bit 31 PF and VF)
+		 */
+		rxval |= BIT(31);
+		/* don't check _DOWN because interrupt isn't being enabled */
+		wr32(hw, INTREG(vector - 1), rxval);
+	}
+
+	if (!test_bit(__I40E_DOWN, &vsi->state))
+		wr32(hw, INTREG(vector - 1), txval);
 }
 
 /**
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +62 -46

154 lines not on this page · raw message

Signature · 1 line
1.9.3
#4 lore raw

PATCH 2/11 i40e/i40evf: refactor irq enable function

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 02/11] i40e/i40evf: refactor irq enable function

From: Jesse Brandeburg <[email protected]>

This change moves a multi-line register setting into a function which simplifies reading the flow of the enable function.

This also fixes a bug where the enable function was enabling the interrupt twice while trying to update the two interrupt throttle rate thresholds for rx and tx.

Quoted 8 lines
Change-ID Ie308f9d0d48540204590cb9d7a5a7b1196f959bb
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 112 +++++++++++++++-------
----
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 108 ++++++++++++++-------
----
 2 files changed, 128 insertions(+), 92 deletions(-)

Patch code changes correctly applied, does not break base driver functionality/compile

#5 lore raw

PATCH 3/11 i40e/i40evf: fix bug in throttle rate math

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

The driver was using a value expressed in 2us increments for the divisor to figure out our bytes/usec values.

Fix the usecs variable to contain a value in microseconds.

Change-ID I5c20493103c295d6f201947bb908add7040b7c41
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 9 ++++++++-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +8 -1
index c023b12..24e8f6b 100644
@@ -829,6 +829,7 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	enum i40e_latency_range new_latency_range = rc->latency_range;
 	u32 new_itr = rc->itr;
 	int bytes_per_int;
+	int usecs;
 
 	if (rc->total_packets == 0 || !rc->itr)
 		return false;
@@ -837,8 +838,14 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	 *   0-10MB/s   lowest (100000 ints/s)
 	 *  10-20MB/s   low    (20000 ints/s)
 	 *  20-1249MB/s bulk   (8000 ints/s)
+	 *
+	 * The math works out because the divisor is in 10^(-6) which
+	 * turns the bytes/us input value into MB/s values, but
+	 * make sure to use usecs, as the register values written
+	 * are in 2 usec increments in the ITR registers.
 	 */
-	bytes_per_int = rc->total_bytes / rc->itr;
+	usecs = (rc->itr << 1);
+	bytes_per_int = rc->total_bytes / usecs;
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
 		if (bytes_per_int > 10)
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +8 -1
index 3d2646b..3f4a595 100644
@@ -333,6 +333,7 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	enum i40e_latency_range new_latency_range = rc->latency_range;
 	u32 new_itr = rc->itr;
 	int bytes_per_int;
+	int usecs;
 
 	if (rc->total_packets == 0 || !rc->itr)
 		return false;
@@ -341,8 +342,14 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	 *   0-10MB/s   lowest (100000 ints/s)
 	 *  10-20MB/s   low    (20000 ints/s)
 	 *  20-1249MB/s bulk   (8000 ints/s)
+	 *
+	 * The math works out because the divisor is in 10^(-6) which
+	 * turns the bytes/us input value into MB/s values, but
+	 * make sure to use usecs, as the register values written
+	 * are in 2 usec increments in the ITR registers.
 	 */
-	bytes_per_int = rc->total_bytes / rc->itr;
+	usecs = (rc->itr << 1);
+	bytes_per_int = rc->total_bytes / usecs;
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
 		if (bytes_per_int > 10)
Signature · 1 line
1.9.3
#6 lore raw

PATCH 3/11 i40e/i40evf: fix bug in throttle rate math

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 03/11] i40e/i40evf: fix bug in throttle rate math

From: Jesse Brandeburg <[email protected]>

The driver was using a value expressed in 2us increments for the divisor to figure out our bytes/usec values.

Quoted 8 lines

Fix the usecs variable to contain a value in microseconds.

Change-ID I5c20493103c295d6f201947bb908add7040b7c41
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 9 ++++++++-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

Code changes present in tree

#7 lore raw

PATCH 4/11 i40e/i40evf: change dynamic interrupt thresholds

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

The dynamic algorithm, while now working, doesn't have good performance in 40G mode.

One part of this patch addresses the high cpu utilization of some small streaming workloads that the driver should reduce CPU in.

It also changes the minimum ITR that the dynamic algorithm will settle on, causing our minimum latency to go from 12us to about 14us, when using adaptive mode.

It also changes the BULK interrupt rate to allow maximum throughput on a 40Gb connection with a single thread of transmit, clamping interrupt rate to 8000 for TX makes single thread traffic go too slow.

The new ULTRA bulk setting is introduced and is used
when the rx packet rate on this queue exceeds 40000 packets per second. This value of 40000 was chosen because the automatic tuning of minimum ITR=20us means that a single queue can't quite achieve that many packets per second from a round-robin test.

Change-ID Icce8faa128688ca5fd2c4229bdd9726877a92ea2
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 27 +++++++++++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h   |  3 +++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 27 +++++++++++++++++++++------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h |  3 +++
 4 files changed, 48 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +21 -6
index 24e8f6b..12bbc83 100644
@@ -827,6 +827,7 @@ void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector)
 static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 {
 	enum i40e_latency_range new_latency_range = rc->latency_range;
+	struct i40e_q_vector *qv = rc->ring->q_vector;
 	u32 new_itr = rc->itr;
 	int bytes_per_int;
 	int usecs;
@@ -835,9 +836,10 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 		return false;
 
 	/* simple throttlerate management
-	 *   0-10MB/s   lowest (100000 ints/s)
+	 *   0-10MB/s   lowest (50000 ints/s)
 	 *  10-20MB/s   low    (20000 ints/s)
-	 *  20-1249MB/s bulk   (8000 ints/s)
+	 *  20-1249MB/s bulk   (18000 ints/s)
+	 *  > 40000 rx packets per second (8000 ints/s)
 	 *
 	 * The math works out because the divisor is in 10^(-6) which
 	 * turns the bytes/us input value into MB/s values, but
@@ -858,24 +860,37 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 			new_latency_range = I40E_LOWEST_LATENCY;
 		break;
 	case I40E_BULK_LATENCY:
-		if (bytes_per_int <= 20)
-			new_latency_range = I40E_LOW_LATENCY;
-		break;
+	case I40E_ULTRA_LATENCY:
 	default:
 		if (bytes_per_int <= 20)
 			new_latency_range = I40E_LOW_LATENCY;
 		break;
 	}
+
+	/* this is to adjust RX more aggressively when streaming small
+	 * packets.  The value of 40000 was picked as it is just beyond
+	 * what the hardware can receive per second if in low latency
+	 * mode.
+	 */
+#define RX_ULTRA_PACKET_RATE 40000
+
+	if ((((rc->total_packets * 1000000) / usecs) > RX_ULTRA_PACKET_RATE) &&
+	    (&qv->rx == rc))
+		new_latency_range = I40E_ULTRA_LATENCY;
+
 	rc->latency_range = new_latency_range;
 
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
-		new_itr = I40E_ITR_100K;
+		new_itr = I40E_ITR_50K;
 		break;
 	case I40E_LOW_LATENCY:
 		new_itr = I40E_ITR_20K;
 		break;
 	case I40E_BULK_LATENCY:
+		new_itr = I40E_ITR_18K;
+		break;
+	case I40E_ULTRA_LATENCY:
 		new_itr = I40E_ITR_8K;
 		break;
 	default:
drivers/net/ethernet/intel/i40e/i40e_txrx.h +3 -0
index 7c0ed84..0fe7eb7 100644
@@ -32,7 +32,9 @@
 #define I40E_MAX_ITR               0x0FF0  /* reg uses 2 usec resolution */
 #define I40E_MIN_ITR               0x0001  /* reg uses 2 usec resolution */
 #define I40E_ITR_100K              0x0005
+#define I40E_ITR_50K               0x000A
 #define I40E_ITR_20K               0x0019
+#define I40E_ITR_18K               0x001B
 #define I40E_ITR_8K                0x003E
 #define I40E_ITR_4K                0x007A
 #define I40E_MAX_INTRL             0x3B    /* reg uses 4 usec resolution */
@@ -296,6 +298,7 @@ enum i40e_latency_range {
 	I40E_LOWEST_LATENCY = 0,
 	I40E_LOW_LATENCY = 1,
 	I40E_BULK_LATENCY = 2,
+	I40E_ULTRA_LATENCY = 3,
 };
 
 struct i40e_ring_container {
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +21 -6
index 3f4a595..7cb0a06 100644
@@ -331,6 +331,7 @@ static void i40evf_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector
 static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 {
 	enum i40e_latency_range new_latency_range = rc->latency_range;
+	struct i40e_q_vector *qv = rc->ring->q_vector;
 	u32 new_itr = rc->itr;
 	int bytes_per_int;
 	int usecs;
@@ -339,9 +340,10 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 		return false;
 
 	/* simple throttlerate management
-	 *   0-10MB/s   lowest (100000 ints/s)
+	 *   0-10MB/s   lowest (50000 ints/s)
 	 *  10-20MB/s   low    (20000 ints/s)
-	 *  20-1249MB/s bulk   (8000 ints/s)
+	 *  20-1249MB/s bulk   (18000 ints/s)
+	 *  > 40000 rx packets per second (8000 ints/s)
 	 *
 	 * The math works out because the divisor is in 10^(-6) which
 	 * turns the bytes/us input value into MB/s values, but
@@ -362,24 +364,37 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 			new_latency_range = I40E_LOWEST_LATENCY;
 		break;
 	case I40E_BULK_LATENCY:
-		if (bytes_per_int <= 20)
-			new_latency_range = I40E_LOW_LATENCY;
-		break;
+	case I40E_ULTRA_LATENCY:
 	default:
 		if (bytes_per_int <= 20)
 			new_latency_range = I40E_LOW_LATENCY;
 		break;
 	}
+
+	/* this is to adjust RX more aggressively when streaming small
+	 * packets.  The value of 40000 was picked as it is just beyond
+	 * what the hardware can receive per second if in low latency
+	 * mode.
+	 */
+#define RX_ULTRA_PACKET_RATE 40000
+
+	if ((((rc->total_packets * 1000000) / usecs) > RX_ULTRA_PACKET_RATE) &&
+	    (&qv->rx == rc))
+		new_latency_range = I40E_ULTRA_LATENCY;
+
 	rc->latency_range = new_latency_range;
 
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
-		new_itr = I40E_ITR_100K;
+		new_itr = I40E_ITR_50K;
 		break;
 	case I40E_LOW_LATENCY:
 		new_itr = I40E_ITR_20K;
 		break;
 	case I40E_BULK_LATENCY:
+		new_itr = I40E_ITR_18K;
+		break;
+	case I40E_ULTRA_LATENCY:
 		new_itr = I40E_ITR_8K;
 		break;
 	default:
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +3 -0
index c4f5a4e..27f0b626 100644
@@ -32,7 +32,9 @@
 #define I40E_MAX_ITR               0x0FF0  /* reg uses 2 usec resolution */
 #define I40E_MIN_ITR               0x0001  /* reg uses 2 usec resolution */
 #define I40E_ITR_100K              0x0005
+#define I40E_ITR_50K               0x000A
 #define I40E_ITR_20K               0x0019
+#define I40E_ITR_18K               0x001B
 #define I40E_ITR_8K                0x003E
 #define I40E_ITR_4K                0x007A
 #define I40E_MAX_INTRL             0x3B    /* reg uses 4 usec resolution */
@@ -291,6 +293,7 @@ enum i40e_latency_range {
 	I40E_LOWEST_LATENCY = 0,
 	I40E_LOW_LATENCY = 1,
 	I40E_BULK_LATENCY = 2,
+	I40E_ULTRA_LATENCY = 3,
 };
 
 struct i40e_ring_container {
Signature · 1 line
1.9.3
#8 lore raw

PATCH 4/11 i40e/i40evf: change dynamic interrupt thresholds

Quoted 32 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 04/11] i40e/i40evf: change dynamic interrupt thresholds

From: Jesse Brandeburg <[email protected]>

The dynamic algorithm, while now working, doesn't have good performance in 40G mode.

One part of this patch addresses the high cpu utilization of some small streaming workloads that the driver should reduce CPU in.

It also changes the minimum ITR that the dynamic algorithm will settle on, causing our minimum latency to go from 12us to about 14us, when using adaptive mode.

It also changes the BULK interrupt rate to allow maximum throughput on a 40Gb connection with a single thread of transmit, clamping interrupt rate to 8000 for TX makes single thread traffic go too slow.

The new ULTRA bulk setting is introduced and is used when the rx packet rate on this queue exceeds 40000 packets per second. This value of 40000 was chosen because the automatic tuning of minimum ITR=20us means that a single queue can't quite achieve that many packets per second from a round-robin test.

Change-ID Icce8faa128688ca5fd2c4229bdd9726877a92ea2
Quoted 8 lines
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 27
+++++++++++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h   |  3 +++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 27
+++++++++++++++++++++------
drivers/net/ethernet/intel/i40evf/i40e_txrx.h |  3 +++
 4 files changed, 48 insertions(+), 12 deletions(-)

Code changes present in tree

#9 lore raw

PATCH 5/11 i40e/i40evf: adjust interrupt throttle less frequently

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

The adaptive ITR (interrupt throttle rate) algorithm was adjusting the hardware's interrupt rate too frequently. This caused a lot of variation in the interrupt rate for fairly constant workloads.

Change the code to have a counter and adjust only once every N number of interrupts.

Change-ID I0460f1f86571037484eca5aca36ac4d889cb8389
---
 drivers/net/ethernet/intel/i40e/i40e.h          |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c     |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c     | 22 ++++++++++++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.h     |  4 ++--
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c   | 23 +++++++++++++++++++++--
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h   |  4 ++--
 drivers/net/ethernet/intel/i40evf/i40evf.h      |  2 ++
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |  2 ++
 8 files changed, 53 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
index 666f7a5..1d9af62 100644
@@ -577,6 +577,8 @@ struct i40e_q_vector {
 	struct rcu_head rcu;	/* to avoid race with update stats on free */
 	char name[I40E_INT_NAME_STR_LEN];
 	bool arm_wb_state;
+#define ITR_COUNTDOWN_START 100
+	u8 itr_countdown;	/* when 0 should adjust ITR */
 } ____cacheline_internodealigned_in_smp;
 
 /* lan device */
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -0
index e383ac3..2ecc6df 100644
@@ -3101,6 +3101,7 @@ static void i40e_vsi_configure_msix(struct i40e_vsi *vsi)
 	for (i = 0; i < vsi->num_q_vectors; i++, vector++) {
 		struct i40e_q_vector *q_vector = vsi->q_vectors[i];
 
+		q_vector->itr_countdown = ITR_COUNTDOWN_START;
 		q_vector->rx.itr = ITR_TO_REG(vsi->rx_itr_setting);
 		q_vector->rx.latency_range = I40E_LOW_LATENCY;
 		wr32(hw, I40E_PFINT_ITRN(I40E_RX_ITR, vector - 1),
@@ -3196,6 +3197,7 @@ static void i40e_configure_msi_and_legacy(struct i40e_vsi *vsi)
 	u32 val;
 
 	/* set the ITR configuration */
+	q_vector->itr_countdown = ITR_COUNTDOWN_START;
 	q_vector->rx.itr = ITR_TO_REG(vsi->rx_itr_setting);
 	q_vector->rx.latency_range = I40E_LOW_LATENCY;
 	wr32(hw, I40E_PFINT_ITR0(I40E_RX_ITR), q_vector->rx.itr);
drivers/net/ethernet/intel/i40e/i40e_txrx.c +20 -2
index 12bbc83..096bfbc 100644
@@ -844,10 +844,12 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	 * The math works out because the divisor is in 10^(-6) which
 	 * turns the bytes/us input value into MB/s values, but
 	 * make sure to use usecs, as the register values written
-	 * are in 2 usec increments in the ITR registers.
+	 * are in 2 usec increments in the ITR registers, and make sure
+	 * to use the smoothed values that the countdown timer gives us.
 	 */
-	usecs = (rc->itr << 1);
+	usecs = (rc->itr << 1) * ITR_COUNTDOWN_START;
 	bytes_per_int = rc->total_bytes / usecs;
+
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
 		if (bytes_per_int > 10)
@@ -1805,8 +1807,17 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 
 	vector = (q_vector->v_idx + vsi->base_vector);
 
+	/* avoid dynamic calulation if in countdown mode OR if
+	 * all dynamic is disabled
+	 */
 	rxval = txval = i40e_buildreg_itr(I40E_ITR_NONE, 0);
 
+	if (q_vector->itr_countdown > 0 ||
+	    (!ITR_IS_DYNAMIC(vsi->rx_itr_setting) &&
+	     !ITR_IS_DYNAMIC(vsi->tx_itr_setting))) {
+		goto enable_int;
+	}
+
 	if (ITR_IS_DYNAMIC(vsi->rx_itr_setting)) {
 		rx = i40e_set_new_dynamic_itr(&q_vector->rx);
 		rxval = i40e_buildreg_itr(I40E_RX_ITR, q_vector->rx.itr);
@@ -1844,8 +1855,15 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 		wr32(hw, INTREG(vector - 1), rxval);
 	}
 
+enable_int:
 	if (!test_bit(__I40E_DOWN, &vsi->state))
 		wr32(hw, INTREG(vector - 1), txval);
+
+	if (q_vector->itr_countdown)
+		q_vector->itr_countdown--;
+	else
+		q_vector->itr_countdown = ITR_COUNTDOWN_START;
+
 }
 
 /**
drivers/net/ethernet/intel/i40e/i40e_txrx.h +2 -2
index 0fe7eb7..6779fb7 100644
@@ -38,8 +38,8 @@
 #define I40E_ITR_8K                0x003E
 #define I40E_ITR_4K                0x007A
 #define I40E_MAX_INTRL             0x3B    /* reg uses 4 usec resolution */
-#define I40E_ITR_RX_DEF            I40E_ITR_8K
-#define I40E_ITR_TX_DEF            I40E_ITR_4K
+#define I40E_ITR_RX_DEF            I40E_ITR_20K
+#define I40E_ITR_TX_DEF            I40E_ITR_20K
 #define I40E_ITR_DYNAMIC           0x8000  /* use top bit as a flag */
 #define I40E_MIN_INT_RATE          250     /* ~= 1000000 / (I40E_MAX_ITR * 2) */
 #define I40E_MAX_INT_RATE          500000  /* == 1000000 / (I40E_MIN_ITR * 2) */
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +21 -2
index 7cb0a06..0fe2625 100644
@@ -348,10 +348,12 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 	 * The math works out because the divisor is in 10^(-6) which
 	 * turns the bytes/us input value into MB/s values, but
 	 * make sure to use usecs, as the register values written
-	 * are in 2 usec increments in the ITR registers.
+	 * are in 2 usec increments in the ITR registers, and make sure
+	 * to use the smoothed values that the countdown timer gives us.
 	 */
-	usecs = (rc->itr << 1);
+	usecs = (rc->itr << 1) * ITR_COUNTDOWN_START;
 	bytes_per_int = rc->total_bytes / usecs;
+
 	switch (new_latency_range) {
 	case I40E_LOWEST_LATENCY:
 		if (bytes_per_int > 10)
@@ -1245,8 +1247,18 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 	int vector;
 
 	vector = (q_vector->v_idx + vsi->base_vector);
+
+	/* avoid dynamic calulation if in countdown mode OR if
+	 * all dynamic is disabled
+	 */
 	rxval = txval = i40e_buildreg_itr(I40E_ITR_NONE, 0);
 
+	if (q_vector->itr_countdown > 0 ||
+	    (!ITR_IS_DYNAMIC(vsi->rx_itr_setting) &&
+	     !ITR_IS_DYNAMIC(vsi->tx_itr_setting))) {
+		goto enable_int;
+	}
+
 	if (ITR_IS_DYNAMIC(vsi->rx_itr_setting)) {
 		rx = i40e_set_new_dynamic_itr(&q_vector->rx);
 		rxval = i40e_buildreg_itr(I40E_RX_ITR, q_vector->rx.itr);
@@ -1282,8 +1294,15 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 		wr32(hw, INTREG(vector - 1), rxval);
 	}
 
+enable_int:
 	if (!test_bit(__I40E_DOWN, &vsi->state))
 		wr32(hw, INTREG(vector - 1), txval);
+
+	if (q_vector->itr_countdown)
+		q_vector->itr_countdown--;
+	else
+		q_vector->itr_countdown = ITR_COUNTDOWN_START;
+
 }
 
 /**
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +2 -2
index 27f0b626..ee48caa 100644
@@ -38,8 +38,8 @@
 #define I40E_ITR_8K                0x003E
 #define I40E_ITR_4K                0x007A
 #define I40E_MAX_INTRL             0x3B    /* reg uses 4 usec resolution */
-#define I40E_ITR_RX_DEF            I40E_ITR_8K
-#define I40E_ITR_TX_DEF            I40E_ITR_4K
+#define I40E_ITR_RX_DEF            I40E_ITR_20K
+#define I40E_ITR_TX_DEF            I40E_ITR_20K
 #define I40E_ITR_DYNAMIC           0x8000  /* use top bit as a flag */
 #define I40E_MIN_INT_RATE          250     /* ~= 1000000 / (I40E_MAX_ITR * 2) */
 #define I40E_MAX_INT_RATE          500000  /* == 1000000 / (I40E_MIN_ITR * 2) */
drivers/net/ethernet/intel/i40evf/i40evf.h +2 -0
index d6cd2c8..0147038 100644
@@ -112,6 +112,8 @@ struct i40e_q_vector {
 	struct i40e_ring_container tx;
 	u32 ring_mask;
 	u8 num_ringpairs;	/* total number of ring pairs in vector */
+#define ITR_COUNTDOWN_START 100
+	u8 itr_countdown;	/* when 0 or 1 update ITR */
 	int v_idx;	  /* vector index in list */
 	char name[IFNAMSIZ + 9];
 	bool arm_wb_state;
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -0
index d29519d..7668098 100644
@@ -357,6 +357,7 @@ i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)
 	q_vector->rx.ring = rx_ring;
 	q_vector->rx.count++;
 	q_vector->rx.latency_range = I40E_LOW_LATENCY;
+	q_vector->itr_countdown = ITR_COUNTDOWN_START;
 }
 
 /**
@@ -377,6 +378,7 @@ i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)
 	q_vector->tx.ring = tx_ring;
 	q_vector->tx.count++;
 	q_vector->tx.latency_range = I40E_LOW_LATENCY;
+	q_vector->itr_countdown = ITR_COUNTDOWN_START;
 	q_vector->num_ringpairs++;
 	q_vector->ring_mask |= BIT(t_idx);
 }
Signature · 1 line
1.9.3
#10 lore raw

PATCH 5/11 i40e/i40evf: adjust interrupt throttle less frequently

Quoted 19 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 05/11] i40e/i40evf: adjust interrupt throttle less frequently

From: Jesse Brandeburg <[email protected]>

The adaptive ITR (interrupt throttle rate) algorithm was adjusting the hardware's interrupt rate too frequently. This caused a lot of variation in the interrupt rate for fairly constant workloads.

Change the code to have a counter and adjust only once every N number of interrupts.

Change-ID I0460f1f86571037484eca5aca36ac4d889cb8389
Quoted 12 lines
---
 drivers/net/ethernet/intel/i40e/i40e.h          |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c     |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c     | 22
++++++++++++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.h     |  4 ++--
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c   | 23
+++++++++++++++++++++--
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h   |  4 ++--
 drivers/net/ethernet/intel/i40evf/i40evf.h      |  2 ++
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |  2 ++
 8 files changed, 53 insertions(+), 8 deletions(-)

Patch code changes correctly applied, lower CPU usage and higher throughput observed with patch applied.

#11 lore raw

PATCH 6/11 i40e: Fix for Tools loopback test failing after driver load

In reply to Catherine Sullivan

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where our Tools MAC Loopback test, after driver unbind would fail. This was because the hw was configured for multiqueue and unbind operation did not clear this configuration. The problem is fixed by resetting this configuration in i40e_remove.

Change-ID I130c05138319182ed1476d3a0b5222d6a6320af9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +5 -0
index 2ecc6df..bc48be4 100644
@@ -10642,6 +10642,7 @@ err_dma:
 static void i40e_remove(struct pci_dev *pdev)
 {
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
+	struct i40e_hw *hw = &pf->hw;
 	i40e_status ret_code;
 	int i;
 
@@ -10649,6 +10650,10 @@ static void i40e_remove(struct pci_dev *pdev)
 
 	i40e_ptp_stop(pf);
 
+	/* Disable RSS in hw */
+	wr32(hw, I40E_PFQF_HENA(0), 0);
+	wr32(hw, I40E_PFQF_HENA(1), 0);
+
 	/* no more scheduling of any task */
 	set_bit(__I40E_DOWN, &pf->state);
 	del_timer_sync(&pf->service_timer);
Signature · 1 line
1.9.3
#12 lore raw

PATCH 6/11 i40e: Fix for Tools loopback test failing after driver load

Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 06/11] i40e: Fix for Tools loopback test failing after driver load

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where our Tools MAC Loopback test, after driver unbind would fail. This was because the hw was configured for multiqueue and unbind operation did not clear this configuration.
The problem is fixed by resetting this configuration in i40e_remove.

Quoted 5 lines
Change-ID I130c05138319182ed1476d3a0b5222d6a6320af9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
 1 file changed, 5 insertions(+)

Code changes present in tree, MAC loopback test passes in LANConf.

#13 lore raw

PATCH 7/11 i40e: fix for PHY NVM interaction problem

In reply to Catherine Sullivan

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where the NVMUpdate Tool, when using the PHY NVM feature, gets bad data from the PHY because of contention on the MDIO interface from get phy capability calls from the driver during regular operations. The problem is fixed by adding a check if media is available before calling get phy capability function because that bit is not set when device is in PHY interaction mode.

Change-ID Ib89991b0f841808dd92410f5e8683d6ee3301cd0
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +8 -6
index 01d5f0b..a1cfb16 100644
@@ -2346,13 +2346,15 @@ i40e_status i40e_update_link_info(struct i40e_hw *hw)
 	if (status)
 		return status;
 
-	status = i40e_aq_get_phy_capabilities(hw, false, false, &abilities,
-					      NULL);
-	if (status)
-		return status;
+	if (hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) {
+		status = i40e_aq_get_phy_capabilities(hw, false, false,
+						      &abilities, NULL);
+		if (status)
+			return status;
 
-	memcpy(hw->phy.link_info.module_type, &abilities.module_type,
-	       sizeof(hw->phy.link_info.module_type));
+		memcpy(hw->phy.link_info.module_type, &abilities.module_type,
+		       sizeof(hw->phy.link_info.module_type));
+	}
 
 	return status;
 }
Signature · 1 line
1.9.3
#14 lore raw

PATCH 7/11 i40e: fix for PHY NVM interaction problem

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 07/11] i40e: fix for PHY NVM interaction problem

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where the NVMUpdate Tool, when using the PHY NVM feature, gets bad data from the PHY because of contention on the MDIO interface from get phy capability calls from the driver during regular operations. The problem is fixed by adding a check if media is available before calling get phy capability function because that bit is not set when device is in PHY interaction mode.

Quoted 5 lines
Change-ID Ib89991b0f841808dd92410f5e8683d6ee3301cd0
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Patch code changes correctly applied, able to dump and verify PHY flash using LANConf successfully. (QV Driverless Mode)

#15 lore raw

PATCH 8/11 i40e/i40evf: Fix an accidental error with BIT_ULL replacement

In reply to Catherine Sullivan

From: Anjali Singhai Jain <[email protected]>

A mask value of 0x1FF was accidentally replaced with a bit mask causing flow director sideband to be broken.

Change-ID Id3387f67dd1b567b41692b570b383c58671e1eae
---
 drivers/net/ethernet/intel/i40e/i40e_type.h   | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40e_type.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_type.h +2 -2
index f631ca0..dd2da35 100644
@@ -1068,8 +1068,8 @@ enum i40e_filter_program_desc_fd_status {
 };
 
 #define I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT	23
-#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK \
-				       BIT_ULL(I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
+#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK	(0x1FFUL << \
+					 I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
 
 #define I40E_TXD_FLTR_QW1_CMD_SHIFT	4
 #define I40E_TXD_FLTR_QW1_CMD_MASK	(0xFFFFULL << \
drivers/net/ethernet/intel/i40evf/i40e_type.h +2 -2
index 85af3b4..301fe2b 100644
@@ -1055,8 +1055,8 @@ enum i40e_filter_program_desc_fd_status {
 };
 
 #define I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT	23
-#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK \
-				       BIT_ULL(I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
+#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK	(0x1FFUL << \
+					 I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
 
 #define I40E_TXD_FLTR_QW1_CMD_SHIFT	4
 #define I40E_TXD_FLTR_QW1_CMD_MASK	(0xFFFFULL << \
Signature · 1 line
1.9.3
#16 lore raw

PATCH 8/11 i40e/i40evf: Fix an accidental error with BIT_ULL replacement

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 08/11] i40e/i40evf: Fix an accidental error with BIT_ULL replacement

From: Anjali Singhai Jain <[email protected]>

A mask value of 0x1FF was accidentally replaced with a bit mask causing flow director sideband to be broken.

Quoted 6 lines
Change-ID Id3387f67dd1b567b41692b570b383c58671e1eae
---
 drivers/net/ethernet/intel/i40e/i40e_type.h   | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40e_type.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Code changes present in tree

#17 lore raw

PATCH 9/11 i40e: Fix order of checks when enabling/disabling autoneg in ethtool

In reply to Catherine Sullivan

We were previously checking if autoneg was allowed to change before checking if autoneg was changing. We need to do this in the other order or else we will erroneously return EINVAL when autoneg is not changing.

Change-ID Iff9f7d1c9bddc1ad1e5d227d4f42754f90155410
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 29 ++++++++++++++------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +16 -13
index d196e0b..fcbe719 100644
@@ -661,28 +661,31 @@ static int i40e_set_settings(struct net_device *netdev,
 
 	/* Check autoneg */
 	if (autoneg == AUTONEG_ENABLE) {
-		/* If autoneg is not supported, return error */
-		if (!(safe_ecmd.supported & SUPPORTED_Autoneg)) {
-			netdev_info(netdev, "Autoneg not supported on this phy\n");
-			return -EINVAL;
-		}
 		/* If autoneg was not already enabled */
 		if (!(hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED)) {
+			/* If autoneg is not supported, return error */
+			if (!(safe_ecmd.supported & SUPPORTED_Autoneg)) {
+				netdev_info(netdev, "Autoneg not supported on this phy\n");
+				return -EINVAL;
+			}
+			/* Autoneg is allowed to change */
 			config.abilities = abilities.abilities |
 					   I40E_AQ_PHY_ENABLE_AN;
 			change = true;
 		}
 	} else {
-		/* If autoneg is supported 10GBASE_T is the only phy that
-		 * can disable it, so otherwise return error
-		 */
-		if (safe_ecmd.supported & SUPPORTED_Autoneg &&
-		    hw->phy.link_info.phy_type != I40E_PHY_TYPE_10GBASE_T) {
-			netdev_info(netdev, "Autoneg cannot be disabled on this phy\n");
-			return -EINVAL;
-		}
 		/* If autoneg is currently enabled */
 		if (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) {
+			/* If autoneg is supported 10GBASE_T is the only phy
+			 * that can disable it, so otherwise return error
+			 */
+			if (safe_ecmd.supported & SUPPORTED_Autoneg &&
+			    hw->phy.link_info.phy_type !=
+			    I40E_PHY_TYPE_10GBASE_T) {
+				netdev_info(netdev, "Autoneg cannot be disabled on this phy\n");
+				return -EINVAL;
+			}
+			/* Autoneg is allowed to change */
 			config.abilities = abilities.abilities &
 					   ~I40E_AQ_PHY_ENABLE_AN;
 			change = true;
Signature · 1 line
1.9.3
#18 lore raw

PATCH 9/11 i40e: Fix order of checks when enabling/disabling autoneg in ethtool

Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 09/11] i40e: Fix order of checks when enabling/disabling autoneg in ethtool

We were previously checking if autoneg was allowed to change before checking if autoneg was changing. We need to do this in the other order or else we will erroneously return EINVAL when autoneg is not changing.

Quoted 6 lines
Change-ID Iff9f7d1c9bddc1ad1e5d227d4f42754f90155410
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 29 ++++++++++++++-------
-----
 1 file changed, 16 insertions(+), 13 deletions(-)

Patch code changes correctly applied, per HSD 5645268 notes "With i40e-1.3.38, the behavior described in this HSD no longer occurs. I am able to set advertise 0x20 and then return to advertise 0x1020 without error."

#19 lore raw

PATCH 9/11 i40e: Fix order of checks when enabling/disabling autoneg in ethtool

In reply to Catherine Sullivan
Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 09/11] i40e: Fix order of checks when enabling/disabling autoneg in ethtool

We were previously checking if autoneg was allowed to change before checking if autoneg was changing. We need to do this in the other order or else we will erroneously return EINVAL when autoneg is not changing.

Quoted 6 lines
Change-ID Iff9f7d1c9bddc1ad1e5d227d4f42754f90155410
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 29 ++++++++++++++-------
-----
 1 file changed, 16 insertions(+), 13 deletions(-)

Patch code changes correctly applied, per HSD 5645268 notes "With i40e-1.3.38, the behavior described in this HSD no longer occurs. I am able to set advertise 0x20 and then return to advertise 0x1020 without error."

#20 lore raw

PATCH 10/11 i40e: Move error message to debug level

In reply to Catherine Sullivan

There is an error coming back from get_phy_capabilities that does not seem to have any functional implications. We will continue looking into why this error message is occurring, but in the meantime, we will move it to debug to avoid confusion.

Change-ID I9091754bf62c066ddedeb249923d85606e2d68ed
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +3 -3
index fcbe719..8d12328 100644
@@ -751,9 +751,9 @@ static int i40e_set_settings(struct net_device *netdev,
 
 		status = i40e_update_link_info(hw);
 		if (status)
-			netdev_info(netdev, "Updating link info failed with err %s aq_err %s\n",
-				    i40e_stat_str(hw, status),
-				    i40e_aq_str(hw, hw->aq.asq_last_status));
+			netdev_dbg(netdev, "Updating link info failed with err %s aq_err %s\n",
+				   i40e_stat_str(hw, status),
+				   i40e_aq_str(hw, hw->aq.asq_last_status));
 
 	} else {
 		netdev_info(netdev, "Nothing changed, exiting without setting anything.\n");
Signature · 1 line
1.9.3
#21 lore raw

PATCH 10/11 i40e: Move error message to debug level

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 10/11] i40e: Move error message to debug level

There is an error coming back from get_phy_capabilities that does not seem to have any functional implications. We will continue looking into why this error message is occurring, but in the meantime, we will move it to debug to avoid confusion.

Quoted 5 lines
Change-ID I9091754bf62c066ddedeb249923d85606e2d68ed
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Code changes present in tree

#22 lore raw

PATCH 11/11 i40e/i40evf: Bump i40e to 1.3.38 and i40evf to 1.3.25

In reply to Catherine Sullivan

Bump.

Change-ID Id0a7ecaa491f88ce94c9eba4901e592a56044ee0
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index bc48be4..c32a716 100644
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 34
+#define DRV_VERSION_BUILD 38
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
index 7668098..1223b46 100644
@@ -34,7 +34,7 @@ char i40evf_driver_name[] = "i40evf";
 static const char i40evf_driver_string[] =
 	"Intel(R) XL710/X710 Virtual Function Network Driver";
 
-#define DRV_VERSION "1.3.21"
+#define DRV_VERSION "1.3.25"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2015 Intel Corporation.";
Signature · 1 line
1.9.3
#23 lore raw

PATCH 11/11 i40e/i40evf: Bump i40e to 1.3.38 and i40evf to 1.3.25

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:17 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S17 11/11] i40e/i40evf: Bump i40e to 1.3.38 and i40evf to 1.3.25

Quoted 8 lines

Bump.

Change-ID Id0a7ecaa491f88ce94c9eba4901e592a56044ee0
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Code changes present in tree, modinfo returns correct version for i40e and i40evf