All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates
@ 2015-10-26 23:44 Catherine Sullivan
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion Catherine Sullivan
                   ` (15 more replies)
  0 siblings, 16 replies; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

Anjali fixes the RS bit update in Tx path and disables the force WB
workaround.

Carolyn updates the fw version error messaging.

Helin adds new fields to store user configuraion, renames rss_size to
alloc_rss_size in i40e_pf, renames vf adapter specific rss function, creates
a generic config rss function, creates a generic get rss function, adds new
fields to store user configuration of RSS, and fixes a confusing message.

Jesse adds a prefetch of skb data on transmit.

Mitch makes an  error message more useful, lets the VF give up when it gets
ERR_PARAM from the PF, allocates queue vectors dynamically, and allocates
ring structs dynamically.

 drivers/net/ethernet/intel/i40e/i40e.h             |  10 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  31 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  98 +++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |   3 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   4 +-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      | 123 ++++---
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h      |   2 +
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  16 +-
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  79 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 403 +++++++++++++++------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  12 +-
 11 files changed, 545 insertions(+), 236 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-29 21:59   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf Catherine Sullivan
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: I73886469dca9e9f6b16d842182a87f3f4009f95d

---
Testing-hints: Test with the next patch.
 drivers/net/ethernet/intel/i40e/i40e.h         |  2 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 +++++++++------
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 52 +++++++++++++++++++++++---
 3 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 89f5323..6efab66 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -508,6 +508,8 @@ struct i40e_vsi {
 
 	u16 rss_table_size;
 	u16 rss_size;
+	u8  *rss_hkey_user; /* User configured hash keys */
+	u8  *rss_lut_user;  /* User configured lookup table entries */
 
 	u16 max_frame;
 	u16 rx_hdr_len;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 6cb2b34..b52c509 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2651,10 +2651,8 @@ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
-	u8 seed_def[I40E_HKEY_ARRAY_SIZE];
-	u8 *lut, *seed = NULL;
+	u8 *seed = NULL;
 	u16 i;
-	int ret;
 
 	if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
@@ -2663,18 +2661,27 @@ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,
 		return 0;
 
 	if (key) {
-		memcpy(seed_def, key, I40E_HKEY_ARRAY_SIZE);
-		seed = seed_def;
+		if (!vsi->rss_hkey_user) {
+			vsi->rss_hkey_user = kzalloc(I40E_HKEY_ARRAY_SIZE,
+						     GFP_KERNEL);
+			if (!vsi->rss_hkey_user)
+				return -ENOMEM;
+		}
+		memcpy(vsi->rss_hkey_user, key, I40E_HKEY_ARRAY_SIZE);
+		seed = vsi->rss_hkey_user;
 	}
-	lut = kzalloc(I40E_HLUT_ARRAY_SIZE, GFP_KERNEL);
-	if (!lut)
-		return -ENOMEM;
+	if (!vsi->rss_lut_user) {
+		vsi->rss_lut_user = kzalloc(I40E_HLUT_ARRAY_SIZE, GFP_KERNEL);
+		if (!vsi->rss_lut_user)
+			return -ENOMEM;
+	}
+
+	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
 	for (i = 0; i < I40E_HLUT_ARRAY_SIZE; i++)
-		lut[i] = (u8)(indir[i]);
-	ret = i40e_config_rss(vsi, seed, lut, I40E_HLUT_ARRAY_SIZE);
-	kfree(lut);
+		vsi->rss_lut_user[i] = (u8)(indir[i]);
 
-	return ret;
+	return i40e_config_rss(vsi, seed, vsi->rss_lut_user,
+			       I40E_HLUT_ARRAY_SIZE);
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4b7d874..c0a784f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7301,6 +7301,23 @@ static void i40e_vsi_free_arrays(struct i40e_vsi *vsi, bool free_qvectors)
 }
 
 /**
+ * i40e_clear_rss_config_user - clear the user configured RSS hash keys
+ * and lookup table
+ * @vsi: Pointer to VSI structure
+ */
+static void i40e_clear_rss_config_user(struct i40e_vsi *vsi)
+{
+	if (!vsi)
+		return;
+
+	kfree(vsi->rss_hkey_user);
+	vsi->rss_hkey_user = NULL;
+
+	kfree(vsi->rss_lut_user);
+	vsi->rss_lut_user = NULL;
+}
+
+/**
  * i40e_vsi_clear - Deallocate the VSI provided
  * @vsi: the VSI being un-configured
  **/
@@ -7337,6 +7354,7 @@ static int i40e_vsi_clear(struct i40e_vsi *vsi)
 	i40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx);
 
 	i40e_vsi_free_arrays(vsi, true);
+	i40e_clear_rss_config_user(vsi);
 
 	pf->vsi[vsi->idx] = NULL;
 	if (vsi->idx < pf->next_vsi)
@@ -8015,8 +8033,6 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
 	wr32(hw, I40E_PFQF_HENA(0), (u32)hena);
 	wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32));
 
-	vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
-
 	/* Determine the RSS table size based on the hardware capabilities */
 	reg_val = rd32(hw, I40E_PFQF_CTL_0);
 	reg_val = (pf->rss_table_size == 512) ?
@@ -8024,15 +8040,28 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
 			(reg_val & ~I40E_PFQF_CTL_0_HASHLUTSIZE_512);
 	wr32(hw, I40E_PFQF_CTL_0, reg_val);
 
+	/* Determine the RSS size of the VSI */
+	if (!vsi->rss_size)
+		vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+
 	lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
 	if (!lut)
 		return -ENOMEM;
 
-	i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
+	/* Use user configured lut if there is one, otherwise use default */
+	if (vsi->rss_lut_user)
+		memcpy(lut, vsi->rss_lut_user, vsi->rss_table_size);
+	else
+		i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
 
-	netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
+	/* Use user configured hash key if there is one, otherwise
+	 * use default.
+	 */
+	if (vsi->rss_hkey_user)
+		memcpy(seed, vsi->rss_hkey_user, I40E_HKEY_ARRAY_SIZE);
+	else
+		netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
 	ret = i40e_config_rss(vsi, seed, lut, vsi->rss_table_size);
-
 	kfree(lut);
 
 	return ret;
@@ -8063,6 +8092,19 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 		pf->rss_size = new_rss_size;
 
 		i40e_reset_and_rebuild(pf, true);
+
+		/* Discard the user configured hash keys and lut, if less
+		 * queues are enabled.
+		 */
+		if (queue_count < vsi->rss_size) {
+			i40e_clear_rss_config_user(vsi);
+			dev_dbg(&pf->pdev->dev,
+				"discard user configured hash keys and lut\n");
+		}
+
+		/* Reset vsi->rss_size, as number of enabled queues changed */
+		vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+
 		i40e_pf_config_rss(pf);
 	}
 	dev_info(&pf->pdev->dev, "RSS count:  %d\n", pf->rss_size);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-29 21:59   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround Catherine Sullivan
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

This patch renames rss_size to alloc_rss_size in i40e_pf, which is
clearer and avoids confusion. It also adds comments to the other
related structure members to help clarify usage.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: Ia90090609d006ab589cb639975bb8a0af795d16f

---
Testing-hints: Test all the RSS knobs from ethtool for X[L]710 and X722.
 drivers/net/ethernet/intel/i40e/i40e.h      |  8 ++++----
 drivers/net/ethernet/intel/i40e/i40e_main.c | 31 +++++++++++++++++------------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 6efab66..d854a46 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -266,7 +266,7 @@ struct i40e_pf {
 	u16 num_lan_qps;           /* num lan queues this PF has set up */
 	u16 num_lan_msix;          /* num queue vectors for the base PF vsi */
 	int queues_left;           /* queues left unclaimed */
-	u16 rss_size;              /* num queues in the RSS array */
+	u16 alloc_rss_size;        /* allocated RSS queues */
 	u16 rss_size_max;          /* HW defined max RSS queues */
 	u16 fdir_pf_filter_count;  /* num of guaranteed filters for this PF */
 	u16 num_alloc_vsi;         /* num VSIs this driver supports */
@@ -413,7 +413,7 @@ struct i40e_pf {
 	u32 rx_hwtstamp_cleared;
 	bool ptp_tx;
 	bool ptp_rx;
-	u16 rss_table_size;
+	u16 rss_table_size; /* HW RSS table size */
 	/* These are only valid in NPAR modes */
 	u32 npar_max_bw;
 	u32 npar_min_bw;
@@ -506,8 +506,8 @@ struct i40e_vsi {
 	u16 tx_itr_setting;
 	u16 int_rate_limit;  /* value in usecs */
 
-	u16 rss_table_size;
-	u16 rss_size;
+	u16 rss_table_size; /* HW RSS table size */
+	u16 rss_size;       /* Allocated RSS queues */
 	u8  *rss_hkey_user; /* User configured hash keys */
 	u8  *rss_lut_user;  /* User configured lookup table entries */
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c0a784f..491c82f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1630,7 +1630,8 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
 
 			switch (vsi->type) {
 			case I40E_VSI_MAIN:
-				qcount = min_t(int, pf->rss_size, num_tc_qps);
+				qcount = min_t(int, pf->alloc_rss_size,
+					       num_tc_qps);
 				break;
 #ifdef I40E_FCOE
 			case I40E_VSI_FCOE:
@@ -7883,7 +7884,7 @@ static int i40e_vsi_config_rss(struct i40e_vsi *vsi)
 
 	i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
 	netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
-	vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+	vsi->rss_size = min_t(int, pf->alloc_rss_size, vsi->num_queue_pairs);
 	ret = i40e_config_rss_aq(vsi, seed, lut, vsi->rss_table_size);
 	kfree(lut);
 
@@ -8042,7 +8043,8 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
 
 	/* Determine the RSS size of the VSI */
 	if (!vsi->rss_size)
-		vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+		vsi->rss_size = min_t(int, pf->alloc_rss_size,
+				      vsi->num_queue_pairs);
 
 	lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
 	if (!lut)
@@ -8089,7 +8091,7 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 		vsi->req_queue_pairs = queue_count;
 		i40e_prep_for_reset(pf);
 
-		pf->rss_size = new_rss_size;
+		pf->alloc_rss_size = new_rss_size;
 
 		i40e_reset_and_rebuild(pf, true);
 
@@ -8103,12 +8105,13 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 		}
 
 		/* Reset vsi->rss_size, as number of enabled queues changed */
-		vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs);
+		vsi->rss_size = min_t(int, pf->alloc_rss_size,
+				      vsi->num_queue_pairs);
 
 		i40e_pf_config_rss(pf);
 	}
-	dev_info(&pf->pdev->dev, "RSS count:  %d\n", pf->rss_size);
-	return pf->rss_size;
+	dev_info(&pf->pdev->dev, "RSS count:  %d\n", pf->alloc_rss_size);
+	return pf->alloc_rss_size;
 }
 
 /**
@@ -8279,13 +8282,14 @@ static int i40e_sw_init(struct i40e_pf *pf)
 	 * maximum might end up larger than the available queues
 	 */
 	pf->rss_size_max = BIT(pf->hw.func_caps.rss_table_entry_width);
-	pf->rss_size = 1;
+	pf->alloc_rss_size = 1;
 	pf->rss_table_size = pf->hw.func_caps.rss_table_size;
 	pf->rss_size_max = min_t(int, pf->rss_size_max,
 				 pf->hw.func_caps.num_tx_qp);
 	if (pf->hw.func_caps.rss) {
 		pf->flags |= I40E_FLAG_RSS_ENABLED;
-		pf->rss_size = min_t(int, pf->rss_size_max, num_online_cpus());
+		pf->alloc_rss_size = min_t(int, pf->rss_size_max,
+					   num_online_cpus());
 	}
 
 	/* MFP mode enabled */
@@ -10152,7 +10156,7 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf)
 	    !(pf->flags & I40E_FLAG_MSIX_ENABLED)) {
 		/* one qp for PF, no queues for anything else */
 		queues_left = 0;
-		pf->rss_size = pf->num_lan_qps = 1;
+		pf->alloc_rss_size = pf->num_lan_qps = 1;
 
 		/* make sure all the fancies are disabled */
 		pf->flags &= ~(I40E_FLAG_RSS_ENABLED	|
@@ -10169,7 +10173,7 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf)
 				  I40E_FLAG_FD_ATR_ENABLED |
 				  I40E_FLAG_DCB_CAPABLE))) {
 		/* one qp for PF */
-		pf->rss_size = pf->num_lan_qps = 1;
+		pf->alloc_rss_size = pf->num_lan_qps = 1;
 		queues_left -= pf->num_lan_qps;
 
 		pf->flags &= ~(I40E_FLAG_RSS_ENABLED	|
@@ -10239,8 +10243,9 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf)
 		"qs_avail=%d FD SB=%d lan_qs=%d lan_tc0=%d vf=%d*%d vmdq=%d*%d, remaining=%d\n",
 		pf->hw.func_caps.num_tx_qp,
 		!!(pf->flags & I40E_FLAG_FD_SB_ENABLED),
-		pf->num_lan_qps, pf->rss_size, pf->num_req_vfs, pf->num_vf_qps,
-		pf->num_vmdq_vsis, pf->num_vmdq_qps, queues_left);
+		pf->num_lan_qps, pf->alloc_rss_size, pf->num_req_vfs,
+		pf->num_vf_qps, pf->num_vmdq_vsis, pf->num_vmdq_qps,
+		queues_left);
 #ifdef I40E_FCOE
 	dev_dbg(&pf->pdev->dev, "fcoe queues = %d\n", pf->num_fcoe_qps);
 #endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion Catherine Sullivan
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 19:26   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit Catherine Sullivan
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Anjali Singhai Jain <anjali.singhai@intel.com>

This patch fixes the issue of forcing WB too often causing us to not
benefit from NAPI.

Without this patch we were forcing WB/arming interrupt too often taking
away the benefits of NAPI and causing a performance impact.

With this patch we disable force WB in the clean routine for X710
and XL710 adapters. X722 adapters do not enable interrupt to force
a WB and benefit from WB_ON_ITR and hence force WB is left enabled
for those adapters.
For XL710 and X710 adapters if we have less than 4 packets pending
a software Interrupt triggered from service task will force a WB.

This patch also changes the conditions for setting RS bit as described
in code comments. This optimizes when the HW does a tail bump amd when
it does a WB. It also optimizes when we do a wmb.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Change-ID: Id831e1ae7d3e2ec3f52cd0917b41ce1d22d75d9d

---
Testing-hints: Test with heavy receive side traffic and you should see a
lower interrupt rate, lower CPU utilization, lower packet latency, and
higher transmit throughput.
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 118 ++++++++++++++++----------
 drivers/net/ethernet/intel/i40evf/i40e_txrx.h |   2 +
 2 files changed, 77 insertions(+), 43 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index f82c64a..a7f9840 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -245,16 +245,6 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
 	tx_ring->q_vector->tx.total_bytes += total_bytes;
 	tx_ring->q_vector->tx.total_packets += total_packets;
 
-	/* check to see if there are any non-cache aligned descriptors
-	 * waiting to be written back, and kick the hardware to force
-	 * them to be written back in case of napi polling
-	 */
-	if (budget &&
-	    !((i & WB_STRIDE) == WB_STRIDE) &&
-	    !test_bit(__I40E_DOWN, &tx_ring->vsi->state) &&
-	    (I40E_DESC_UNUSED(tx_ring) != tx_ring->count))
-		tx_ring->arm_wb = true;
-
 	netdev_tx_completed_queue(netdev_get_tx_queue(tx_ring->netdev,
 						      tx_ring->queue_index),
 				  total_packets, total_bytes);
@@ -1771,6 +1761,9 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	u32 td_tag = 0;
 	dma_addr_t dma;
 	u16 gso_segs;
+	u16 desc_count = 0;
+	bool tail_bump = true;
+	bool do_rs = false;
 
 	if (tx_flags & I40E_TX_FLAGS_HW_VLAN) {
 		td_cmd |= I40E_TX_DESC_CMD_IL2TAG1;
@@ -1811,6 +1804,8 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 
 			tx_desc++;
 			i++;
+			desc_count++;
+
 			if (i == tx_ring->count) {
 				tx_desc = I40E_TX_DESC(tx_ring, 0);
 				i = 0;
@@ -1830,6 +1825,8 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 
 		tx_desc++;
 		i++;
+		desc_count++;
+
 		if (i == tx_ring->count) {
 			tx_desc = I40E_TX_DESC(tx_ring, 0);
 			i = 0;
@@ -1844,35 +1841,7 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 		tx_bi = &tx_ring->tx_bi[i];
 	}
 
-	/* Place RS bit on last descriptor of any packet that spans across the
-	 * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline.
-	 */
 #define WB_STRIDE 0x3
-	if (((i & WB_STRIDE) != WB_STRIDE) &&
-	    (first <= &tx_ring->tx_bi[i]) &&
-	    (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) {
-		tx_desc->cmd_type_offset_bsz =
-			build_ctob(td_cmd, td_offset, size, td_tag) |
-			cpu_to_le64((u64)I40E_TX_DESC_CMD_EOP <<
-					 I40E_TXD_QW1_CMD_SHIFT);
-	} else {
-		tx_desc->cmd_type_offset_bsz =
-			build_ctob(td_cmd, td_offset, size, td_tag) |
-			cpu_to_le64((u64)I40E_TXD_CMD <<
-					 I40E_TXD_QW1_CMD_SHIFT);
-	}
-
-	netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
-						 tx_ring->queue_index),
-			     first->bytecount);
-
-	/* Force memory writes to complete before letting h/w
-	 * know there are new descriptors to fetch.  (Only
-	 * applicable for weak-ordered memory model archs,
-	 * such as IA-64).
-	 */
-	wmb();
-
 	/* set next_to_watch value indicating a packet is present */
 	first->next_to_watch = tx_desc;
 
@@ -1882,15 +1851,78 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
 
 	tx_ring->next_to_use = i;
 
+	netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
+						 tx_ring->queue_index),
+						 first->bytecount);
 	i40evf_maybe_stop_tx(tx_ring, DESC_NEEDED);
+
+	/* Algorithm to optimize tail and RS bit setting:
+	 * if xmit_more is supported
+	 *	if xmit_more is true
+	 *		do not update tail and do not mark RS bit.
+	 *	if xmit_more is false and last xmit_more was false
+	 *		if every packet spanned less than 4 desc
+	 *			then set RS bit on 4th packet and update tail
+	 *			on every packet
+	 *		else
+	 *			update tail and set RS bit on every packet.
+	 *	if xmit_more is false and last_xmit_more was true
+	 *		update tail and set RS bit.
+	 * else (kernel < 3.18)
+	 *	if every packet spanned less than 4 desc
+	 *		then set RS bit on 4th packet and update tail
+	 *		on every packet
+	 *	else
+	 *		set RS bit on EOP for every packet and update tail
+	 *
+	 * Optimization: wmb to be issued only in case of tail update.
+	 * Also optimize the Descriptor WB path for RS bit with the same
+	 * algorithm.
+	 *
+	 * Note: If there are less than 4 packets
+	 * pending and interrupts were disabled the service task will
+	 * trigger a force WB.
+	 */
+	if (skb->xmit_more  &&
+	    !netif_xmit_stopped(netdev_get_tx_queue(tx_ring->netdev,
+						    tx_ring->queue_index))) {
+		tx_ring->flags |= I40E_TXR_FLAGS_LAST_XMIT_MORE_SET;
+		tail_bump = false;
+	} else if (!skb->xmit_more &&
+		   !netif_xmit_stopped(netdev_get_tx_queue(tx_ring->netdev,
+						       tx_ring->queue_index)) &&
+		   (!(tx_ring->flags & I40E_TXR_FLAGS_LAST_XMIT_MORE_SET)) &&
+		   (tx_ring->packet_stride < WB_STRIDE) &&
+		   (desc_count < WB_STRIDE)) {
+		tx_ring->packet_stride++;
+	} else {
+		tx_ring->packet_stride = 0;
+		tx_ring->flags &= ~I40E_TXR_FLAGS_LAST_XMIT_MORE_SET;
+		do_rs = true;
+	}
+	if (do_rs)
+		tx_ring->packet_stride = 0;
+
+	tx_desc->cmd_type_offset_bsz =
+			build_ctob(td_cmd, td_offset, size, td_tag) |
+			cpu_to_le64((u64)(do_rs ? I40E_TXD_CMD :
+						  I40E_TX_DESC_CMD_EOP) <<
+						  I40E_TXD_QW1_CMD_SHIFT);
+
 	/* notify HW of packet */
-	if (!skb->xmit_more ||
-	    netif_xmit_stopped(netdev_get_tx_queue(tx_ring->netdev,
-						   tx_ring->queue_index)))
-		writel(i, tx_ring->tail);
-	else
+	if (!tail_bump)
 		prefetchw(tx_desc + 1);
 
+	if (tail_bump) {
+		/* Force memory writes to complete before letting h/w
+		 * know there are new descriptors to fetch.  (Only
+		 * applicable for weak-ordered memory model archs,
+		 * such as IA-64).
+		 */
+		wmb();
+		writel(i, tx_ring->tail);
+	}
+
 	return;
 
 dma_error:
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
index 997b374..929ddd9 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h
@@ -268,6 +268,8 @@ struct i40e_ring {
 
 	bool ring_active;		/* is ring online or not */
 	bool arm_wb;		/* do something to arm write back */
+	u8 packet_stride;
+#define I40E_TXR_FLAGS_LAST_XMIT_MORE_SET BIT(2)
 
 	u16 flags;
 #define I40E_TXR_FLAGS_WB_ON_ITR	BIT(0)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (2 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:01   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function Catherine Sullivan
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

Issue a prefetch for data early in the transmit path.
This should not be generally needed for tx traffic, but
it helps immensely for pktgen workloads and should help
for forwarding workloads as well.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Change-ID: Iefee870c20599e0c4240e1d8637e4f16b625f83a

---
Testing-hints: Run transmit traffic UDP and TCP to make sure there is
not a performance (CPU utilization) increase. Run pktgen (Jesse has
helper script available) to see the performance increases with the patch
when sending 64 byte packets. For bonus points could test forwarding
workload for performance improvement.
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 3 +++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 7e7d224..494e6ef 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2807,6 +2807,9 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	int tsyn;
 	int tso;
 
+	/* prefetch the data, we'll need it later */
+	prefetch(skb->data);
+
 	if (0 == i40e_xmit_descriptor_count(skb, tx_ring))
 		return NETDEV_TX_BUSY;
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index a7f9840..35fc721 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1994,6 +1994,9 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
 	u8 hdr_len = 0;
 	int tso;
 
+	/* prefetch the data, we'll need it later */
+	prefetch(skb->data);
+
 	if (0 == i40evf_xmit_descriptor_count(skb, tx_ring))
 		return NETDEV_TX_BUSY;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (3 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 20:08   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config " Catherine Sullivan
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

This patch renames old VF adapter specific rss function to clarify
its scope.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: Ie5253083a44c677ebb7709a8a3a18402ad2dc6a6

---
Testing-hints: Test compile only, no functional change.
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 506c08d..a8f67d3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1295,10 +1295,10 @@ static void i40evf_configure_rss_reg(struct i40evf_adapter *adapter,
 }
 
 /**
- * i40evf_configure_rss - Prepare for RSS
+ * i40evf_init_rss - Prepare for RSS
  * @adapter: board private structure
  **/
-static void i40evf_configure_rss(struct i40evf_adapter *adapter)
+static void i40evf_init_rss(struct i40evf_adapter *adapter)
 {
 	struct i40e_hw *hw = &adapter->hw;
 	u8 seed[I40EVF_HKEY_ARRAY_SIZE];
@@ -1564,7 +1564,7 @@ static void i40evf_watchdog_task(struct work_struct *work)
 		 * PF, so we don't have to set current_op as we will
 		 * not get a response through the ARQ.
 		 */
-		i40evf_configure_rss(adapter);
+		i40evf_init_rss(adapter);
 		adapter->aq_required &= ~I40EVF_FLAG_AQ_CONFIGURE_RSS;
 		goto watchdog_done;
 	}
@@ -2312,7 +2312,7 @@ static void i40evf_init_task(struct work_struct *work)
 		    I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
 		adapter->flags |= I40EVF_FLAG_WB_ON_ITR_CAPABLE;
 	if (!RSS_AQ(adapter))
-		i40evf_configure_rss(adapter);
+		i40evf_init_rss(adapter);
 	err = i40evf_request_misc_irq(adapter);
 	if (err)
 		goto err_sw_init;
@@ -2342,7 +2342,7 @@ static void i40evf_init_task(struct work_struct *work)
 		adapter->aq_required |= I40EVF_FLAG_AQ_CONFIGURE_RSS;
 		mod_timer_pending(&adapter->watchdog_timer, jiffies + 1);
 	} else {
-		i40evf_configure_rss(adapter);
+		i40evf_init_rss(adapter);
 	}
 	return;
 restart:
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config rss function
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (4 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-27 20:16   ` Sullivan, Catherine
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get " Catherine Sullivan
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

There are two ways to configure RSS, this patch adjusts those two
functions with the same input parameters, and creates a more
generic function for configuring RSS.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: Iace73bdeba4831909979bef221011060ab327f71

---
Testing-hints: Test VFQF_HKEY and VFQF_HLUT registers are the same
before and after and make sure that ethtool -x and ethtool -X still work
correctly.
 drivers/net/ethernet/intel/i40evf/i40evf.h         |   3 +
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  29 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 168 +++++++++++++--------
 3 files changed, 130 insertions(+), 70 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index 22fc3d4..b5aa377 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -99,6 +99,7 @@ struct i40e_vsi {
 #define MAX_TX_QUEUES MAX_RX_QUEUES
 
 #define I40EVF_HKEY_ARRAY_SIZE ((I40E_VFQF_HKEY_MAX_INDEX + 1) * 4)
+#define I40EVF_HLUT_ARRAY_SIZE ((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4)
 
 /* MAX_MSIX_Q_VECTORS of these are allocated,
  * but we only use one per queue-specific vector.
@@ -313,4 +314,6 @@ void i40evf_request_reset(struct i40evf_adapter *adapter);
 void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
 				enum i40e_virtchnl_ops v_opcode,
 				i40e_status v_retval, u8 *msg, u16 msglen);
+int i40evf_config_rss(struct i40e_vsi *vsi, const u8 *seed, u8 *lut,
+		      u16 lut_size);
 #endif /* _I40EVF_H_ */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 4790437..fe1d1a3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -668,9 +668,11 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 			   const u8 *key, const u8 hfunc)
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
-	struct i40e_hw *hw = &adapter->hw;
-	u32 hlut_val;
-	int i, j;
+	struct i40e_vsi *vsi = &adapter->vsi;
+	u8 seed_def[I40EVF_HKEY_ARRAY_SIZE];
+	u8 *seed = NULL, *lut;
+	int ret;
+	u16 i;
 
 	/* We do not allow change in unsupported parameters */
 	if (key ||
@@ -679,15 +681,22 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 	if (!indir)
 		return 0;
 
-	for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
-		hlut_val = indir[j++];
-		hlut_val |= indir[j++] << 8;
-		hlut_val |= indir[j++] << 16;
-		hlut_val |= indir[j++] << 24;
-		wr32(hw, I40E_VFQF_HLUT(i), hlut_val);
+	if (key) {
+		memcpy(seed_def, key, I40EVF_HKEY_ARRAY_SIZE);
+		seed = seed_def;
 	}
+	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
+	if (!lut)
+		return -ENOMEM;
 
-	return 0;
+	/* Each 32 bits pointed by 'indir' is sotred with a lut entry */
+	for (i = 0; i < I40EVF_HLUT_ARRAY_SIZE; i++)
+		lut[i] = (u8)(indir[i]);
+
+	ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
+	kfree(lut);
+
+	return ret;
 }
 
 static const struct ethtool_ops i40evf_ethtool_ops = {
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index a8f67d3..65d0e04 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1211,110 +1211,158 @@ out:
 }
 
 /**
- * i40e_configure_rss_aq - Prepare for RSS using AQ commands
+ * i40e_config_rss_aq - Prepare for RSS using AQ commands
  * @vsi: vsi structure
  * @seed: RSS hash seed
+ * @lut: Lookup table
+ * @lut_size: Lookup table size
+ *
+ * Return 0 on success, negative on failure
  **/
-static void i40evf_configure_rss_aq(struct i40e_vsi *vsi, const u8 *seed)
+static int i40evf_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
+				u8 *lut, u16 lut_size)
 {
-	struct i40e_aqc_get_set_rss_key_data rss_key;
 	struct i40evf_adapter *adapter = vsi->back;
 	struct i40e_hw *hw = &adapter->hw;
-	int ret = 0, i;
-	u8 *rss_lut;
+	int ret = 0;
 
 	if (!vsi->id)
-		return;
+		return -EINVAL;
 
 	if (adapter->current_op != I40E_VIRTCHNL_OP_UNKNOWN) {
 		/* bail because we already have a command pending */
 		dev_err(&adapter->pdev->dev, "Cannot confiure RSS, command %d pending\n",
 			adapter->current_op);
-		return;
+		return -EBUSY;
 	}
 
-	memset(&rss_key, 0, sizeof(rss_key));
-	memcpy(&rss_key, seed, sizeof(rss_key));
-
-	rss_lut = kzalloc(((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4), GFP_KERNEL);
-	if (!rss_lut)
-		return;
-
-	/* Populate the LUT with max no. PF queues in round robin fashion */
-	for (i = 0; i <= (I40E_VFQF_HLUT_MAX_INDEX * 4); i++)
-		rss_lut[i] = i % adapter->num_active_queues;
+	if (seed) {
+		struct i40e_aqc_get_set_rss_key_data *rss_key =
+			(struct i40e_aqc_get_set_rss_key_data *)seed;
+		ret = i40evf_aq_set_rss_key(hw, vsi->id, rss_key);
+		if (ret) {
+			dev_err(&adapter->pdev->dev, "Cannot set RSS key, err %s aq_err %s\n",
+				i40evf_stat_str(hw, ret),
+				i40evf_aq_str(hw, hw->aq.asq_last_status));
+			return ret;
+		}
+	}
 
-	ret = i40evf_aq_set_rss_key(hw, vsi->id, &rss_key);
-	if (ret) {
-		dev_err(&adapter->pdev->dev,
-			"Cannot set RSS key, err %s aq_err %s\n",
-			i40evf_stat_str(hw, ret),
-			i40evf_aq_str(hw, hw->aq.asq_last_status));
-		return;
+	if (lut) {
+		ret = i40evf_aq_set_rss_lut(hw, vsi->id, false, lut, lut_size);
+		if (ret) {
+			dev_err(&adapter->pdev->dev,
+				"Cannot set RSS lut, err %s aq_err %s\n",
+				i40evf_stat_str(hw, ret),
+				i40evf_aq_str(hw, hw->aq.asq_last_status));
+			return ret;
+		}
 	}
 
-	ret = i40evf_aq_set_rss_lut(hw, vsi->id, false, rss_lut,
-				    (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4);
-	if (ret)
-		dev_err(&adapter->pdev->dev,
-			"Cannot set RSS lut, err %s aq_err %s\n",
-			i40evf_stat_str(hw, ret),
-			i40evf_aq_str(hw, hw->aq.asq_last_status));
+	return ret;
 }
 
 /**
- * i40e_configure_rss_reg - Prepare for RSS if used
- * @adapter: board private structure
+ * i40evf_config_rss_reg - Configure RSS keys and lut by writing registers
+ * @vsi: Pointer to vsi structure
  * @seed: RSS hash seed
+ * @lut: Lookup table
+ * @lut_size: Lookup table size
+ *
+ * Returns 0 on success, negative on failure
  **/
-static void i40evf_configure_rss_reg(struct i40evf_adapter *adapter,
-				     const u8 *seed)
+static int i40evf_config_rss_reg(struct i40e_vsi *vsi, const u8 *seed,
+				 const u8 *lut, u16 lut_size)
 {
+	struct i40evf_adapter *adapter = vsi->back;
 	struct i40e_hw *hw = &adapter->hw;
-	u32 *seed_dw = (u32 *)seed;
-	u32 cqueue = 0;
-	u32 lut = 0;
-	int i, j;
+	u16 i;
 
-	/* Fill out hash function seed */
-	for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
-		wr32(hw, I40E_VFQF_HKEY(i), seed_dw[i]);
-
-	/* Populate the LUT with max no. PF queues in round robin fashion */
-	for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
-		lut = 0;
-		for (j = 0; j < 4; j++) {
-			if (cqueue == adapter->num_active_queues)
-				cqueue = 0;
-			lut |= ((cqueue) << (8 * j));
-			cqueue++;
-		}
-		wr32(hw, I40E_VFQF_HLUT(i), lut);
+	if (seed) {
+		u32 *seed_dw = (u32 *)seed;
+
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			wr32(hw, I40E_VFQF_HKEY(i), seed_dw[i]);
+	}
+
+	if (lut) {
+		u32 *lut_dw = (u32 *)lut;
+
+		if (lut_size != I40EVF_HLUT_ARRAY_SIZE)
+			return -EINVAL;
+
+		for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++)
+			wr32(hw, I40E_VFQF_HLUT(i), lut_dw[i]);
 	}
 	i40e_flush(hw);
+
+	return 0;
+}
+
+/**
+ * i40evf_config_rss - Configure RSS keys and lut
+ * @vsi: Pointer to vsi structure
+ * @seed: RSS hash seed
+ * @lut: Lookup table
+ * @lut_size: Lookup table size
+ *
+ * Returns 0 on success, negative on failure
+ **/
+int i40evf_config_rss(struct i40e_vsi *vsi, const u8 *seed,
+		      u8 *lut, u16 lut_size)
+{
+	struct i40evf_adapter *adapter = vsi->back;
+
+	if (RSS_AQ(adapter))
+		return i40evf_config_rss_aq(vsi, seed, lut, lut_size);
+	else
+		return i40evf_config_rss_reg(vsi, seed, lut, lut_size);
+}
+
+/**
+ * i40evf_fill_rss_lut - Fill the lut with default values
+ * @lut: Lookup table to be filled with
+ * @rss_table_size: Lookup table size
+ * @rss_size: Range of queue number for hashing
+ **/
+static void i40evf_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size)
+{
+	u16 i;
+
+	for (i = 0; i < rss_table_size; i++)
+		lut[i] = i % rss_size;
 }
 
 /**
  * i40evf_init_rss - Prepare for RSS
  * @adapter: board private structure
+ *
+ * Return 0 on success, negative on failure
  **/
-static void i40evf_init_rss(struct i40evf_adapter *adapter)
+static int i40evf_init_rss(struct i40evf_adapter *adapter)
 {
+	struct i40e_vsi *vsi = &adapter->vsi;
 	struct i40e_hw *hw = &adapter->hw;
 	u8 seed[I40EVF_HKEY_ARRAY_SIZE];
 	u64 hena;
-
-	netdev_rss_key_fill((void *)seed, I40EVF_HKEY_ARRAY_SIZE);
+	u8 *lut;
+	int ret;
 
 	/* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */
 	hena = I40E_DEFAULT_RSS_HENA;
 	wr32(hw, I40E_VFQF_HENA(0), (u32)hena);
 	wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
 
-	if (RSS_AQ(adapter))
-		i40evf_configure_rss_aq(&adapter->vsi, seed);
-	else
-		i40evf_configure_rss_reg(adapter, seed);
+	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
+	if (!lut)
+		return -ENOMEM;
+	i40evf_fill_rss_lut(lut, I40EVF_HLUT_ARRAY_SIZE,
+			    adapter->num_active_queues);
+	netdev_rss_key_fill((void *)seed, I40EVF_HKEY_ARRAY_SIZE);
+	ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
+	kfree(lut);
+
+	return ret;
 }
 
 /**
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get rss function
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (5 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config " Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:21   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS Catherine Sullivan
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

There are two ways to get RSS, this patch implements two functions
with the same input parameters, and creates a more generic function
for getting RSS configuration.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: I12d3b712c21455d47dd0a5aae58fc9b7c680db59

---
Testing-hints: Test RSS still works right on multiple RX queues in the
VF (via testing multiple flows RX). Test setting RSS indirection table
via ethtool -X, and reading via ethtool -x works.
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  2 +
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 35 +++++---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 97 ++++++++++++++++++++++
 3 files changed, 121 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index b5aa377..5f2e61d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -316,4 +316,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
 				i40e_status v_retval, u8 *msg, u16 msglen);
 int i40evf_config_rss(struct i40e_vsi *vsi, const u8 *seed, u8 *lut,
 		      u16 lut_size);
+int i40evf_get_rss(struct i40e_vsi *vsi, const u8 *seed, u8 *lut,
+		   u16 lut_size);
 #endif /* _I40EVF_H_ */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index fe1d1a3..0222e16 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -634,25 +634,34 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
 			   u8 *hfunc)
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
-	struct i40e_hw *hw = &adapter->hw;
-	u32 hlut_val;
-	int i, j;
+	struct i40e_vsi *vsi = &adapter->vsi;
+	u8 *seed = NULL, *lut;
+	int ret;
+	u16 i;
 
 	if (hfunc)
 		*hfunc = ETH_RSS_HASH_TOP;
 	if (!indir)
 		return 0;
 
-	if (indir) {
-		for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
-			hlut_val = rd32(hw, I40E_VFQF_HLUT(i));
-			indir[j++] = hlut_val & 0xff;
-			indir[j++] = (hlut_val >> 8) & 0xff;
-			indir[j++] = (hlut_val >> 16) & 0xff;
-			indir[j++] = (hlut_val >> 24) & 0xff;
-		}
-	}
-	return 0;
+	seed = key;
+
+	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
+	if (!lut)
+		return -ENOMEM;
+
+	ret = i40evf_get_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
+	if (ret)
+		goto out;
+
+	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
+	for (i = 0; i < I40EVF_HLUT_ARRAY_SIZE; i++)
+		indir[i] = (u32)lut[i];
+
+out:
+	kfree(lut);
+
+	return ret;
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 65d0e04..ae20d95 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1300,6 +1300,84 @@ static int i40evf_config_rss_reg(struct i40e_vsi *vsi, const u8 *seed,
 }
 
 /**
+ *  * i40evf_get_rss_aq - Get RSS keys and lut by using AQ commands
+ *  @vsi: Pointer to vsi structure
+ *  @seed: RSS hash seed
+ *  @lut: Lookup table
+ *  @lut_size: Lookup table size
+ *
+ *  Return 0 on success, negative on failure
+ **/
+static int i40evf_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
+			     u8 *lut, u16 lut_size)
+{
+	struct i40evf_adapter *adapter = vsi->back;
+	struct i40e_hw *hw = &adapter->hw;
+	int ret = 0;
+
+	if (seed) {
+		ret = i40evf_aq_get_rss_key(hw, vsi->id,
+			(struct i40e_aqc_get_set_rss_key_data *)seed);
+		if (ret) {
+			dev_err(&adapter->pdev->dev,
+				"Cannot get RSS key, err %s aq_err %s\n",
+				i40evf_stat_str(hw, ret),
+				i40evf_aq_str(hw, hw->aq.asq_last_status));
+			return ret;
+		}
+	}
+
+	if (lut) {
+		ret = i40evf_aq_get_rss_lut(hw, vsi->id, seed, lut, lut_size);
+		if (ret) {
+			dev_err(&adapter->pdev->dev,
+				"Cannot get RSS lut, err %s aq_err %s\n",
+				i40evf_stat_str(hw, ret),
+				i40evf_aq_str(hw, hw->aq.asq_last_status));
+			return ret;
+		}
+	}
+
+	return ret;
+}
+
+/**
+ *  * i40evf_get_rss_reg - Get RSS keys and lut by reading registers
+ *  @vsi: Pointer to vsi structure
+ *  @seed: RSS hash seed
+ *  @lut: Lookup table
+ *  @lut_size: Lookup table size
+ *
+ *  Returns 0 on success, negative on failure
+ **/
+static int i40evf_get_rss_reg(struct i40e_vsi *vsi, const u8 *seed,
+			      const u8 *lut, u16 lut_size)
+{
+	struct i40evf_adapter *adapter = vsi->back;
+	struct i40e_hw *hw = &adapter->hw;
+	u16 i;
+
+	if (seed) {
+		u32 *seed_dw = (u32 *)seed;
+
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			seed_dw[i] = rd32(hw, I40E_VFQF_HKEY(i));
+	}
+
+	if (lut) {
+		u32 *lut_dw = (u32 *)lut;
+
+		if (lut_size != I40EVF_HLUT_ARRAY_SIZE)
+			return -EINVAL;
+
+		for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++)
+			lut_dw[i] = rd32(hw, I40E_VFQF_HLUT(i));
+	}
+
+	return 0;
+}
+
+/**
  * i40evf_config_rss - Configure RSS keys and lut
  * @vsi: Pointer to vsi structure
  * @seed: RSS hash seed
@@ -1320,6 +1398,25 @@ int i40evf_config_rss(struct i40e_vsi *vsi, const u8 *seed,
 }
 
 /**
+ * i40evf_get_rss - Get RSS keys and lut
+ * @vsi: Pointer to vsi structure
+ * @seed: RSS hash seed
+ * @lut: Lookup table
+ * @lut_size: Lookup table size
+ *
+ * Returns 0 on success, negative on failure
+ **/
+int i40evf_get_rss(struct i40e_vsi *vsi, const u8 *seed, u8 *lut, u16 lut_size)
+{
+	struct i40evf_adapter *adapter = vsi->back;
+
+	if (RSS_AQ(adapter))
+		return i40evf_get_rss_aq(vsi, seed, lut, lut_size);
+	else
+		return i40evf_get_rss_reg(vsi, seed, lut, lut_size);
+}
+
+/**
  * i40evf_fill_rss_lut - Fill the lut with default values
  * @lut: Lookup table to be filled with
  * @rss_table_size: Lookup table size
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (6 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get " Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:25   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging Catherine Sullivan
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: Ic5d3db8d9df52182b560248f8cdca9c5c7546879

---
Testing-hints: Test ethtool -x and ethtool -X work correctly on VF.
After VF reset, user configured settings via ethtool -X should be
restored.
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  2 ++
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 31 ++++++++++--------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 37 ++++++++++++++++++++--
 3 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index 5f2e61d..090c604 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -67,6 +67,8 @@ struct i40e_vsi {
 	u16 rx_itr_setting;
 	u16 tx_itr_setting;
 	u16 qs_handle;
+	u8 *rss_hkey_user; /* User configured hash keys */
+	u8 *rss_lut_user;  /* User configured lookup table entries */
 };
 
 /* How many Rx Buffers do we bundle into one write to the hardware ? */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 0222e16..4f4e5a3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -678,9 +678,7 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
 	struct i40e_vsi *vsi = &adapter->vsi;
-	u8 seed_def[I40EVF_HKEY_ARRAY_SIZE];
-	u8 *seed = NULL, *lut;
-	int ret;
+	u8 *seed = NULL;
 	u16 i;
 
 	/* We do not allow change in unsupported parameters */
@@ -691,21 +689,28 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 		return 0;
 
 	if (key) {
-		memcpy(seed_def, key, I40EVF_HKEY_ARRAY_SIZE);
-		seed = seed_def;
+		if (!vsi->rss_hkey_user) {
+			vsi->rss_hkey_user = kzalloc(I40EVF_HKEY_ARRAY_SIZE,
+						     GFP_KERNEL);
+			if (!vsi->rss_hkey_user)
+				return -ENOMEM;
+		}
+		memcpy(vsi->rss_hkey_user, key, I40EVF_HKEY_ARRAY_SIZE);
+		seed = vsi->rss_hkey_user;
+	}
+	if (!vsi->rss_lut_user) {
+		vsi->rss_lut_user = kzalloc(I40EVF_HLUT_ARRAY_SIZE,
+					    GFP_KERNEL);
+		if (!vsi->rss_lut_user)
+			return -ENOMEM;
 	}
-	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
-	if (!lut)
-		return -ENOMEM;
 
 	/* Each 32 bits pointed by 'indir' is sotred with a lut entry */
 	for (i = 0; i < I40EVF_HLUT_ARRAY_SIZE; i++)
-		lut[i] = (u8)(indir[i]);
+		vsi->rss_lut_user[i] = (u8)(indir[i]);
 
-	ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
-	kfree(lut);
-
-	return ret;
+	return i40evf_config_rss(vsi, seed, vsi->rss_lut_user,
+				 I40EVF_HLUT_ARRAY_SIZE);
 }
 
 static const struct ethtool_ops i40evf_ethtool_ops = {
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index ae20d95..52a3286 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1453,9 +1453,21 @@ static int i40evf_init_rss(struct i40evf_adapter *adapter)
 	lut = kzalloc(I40EVF_HLUT_ARRAY_SIZE, GFP_KERNEL);
 	if (!lut)
 		return -ENOMEM;
-	i40evf_fill_rss_lut(lut, I40EVF_HLUT_ARRAY_SIZE,
-			    adapter->num_active_queues);
-	netdev_rss_key_fill((void *)seed, I40EVF_HKEY_ARRAY_SIZE);
+
+	/* Use user configured lut if there is one, otherwise use default */
+	if (vsi->rss_lut_user)
+		memcpy(lut, vsi->rss_lut_user, I40EVF_HLUT_ARRAY_SIZE);
+	else
+		i40evf_fill_rss_lut(lut, I40EVF_HLUT_ARRAY_SIZE,
+				    adapter->num_active_queues);
+
+	/* Use user configured hash key if there is one, otherwise
+	 * user default.
+	 */
+	if (vsi->rss_hkey_user)
+		memcpy(seed, vsi->rss_hkey_user, I40EVF_HKEY_ARRAY_SIZE);
+	else
+		netdev_rss_key_fill((void *)seed, I40EVF_HKEY_ARRAY_SIZE);
 	ret = i40evf_config_rss(vsi, seed, lut, I40EVF_HLUT_ARRAY_SIZE);
 	kfree(lut);
 
@@ -1583,6 +1595,22 @@ err_set_interrupt:
 }
 
 /**
+ * i40evf_clear_rss_config_user - Clear user configurations of RSS
+ * @vsi: Pointer to VSI structure
+ **/
+static void i40evf_clear_rss_config_user(struct i40e_vsi *vsi)
+{
+	if (!vsi)
+		return;
+
+	kfree(vsi->rss_hkey_user);
+	vsi->rss_hkey_user = NULL;
+
+	kfree(vsi->rss_lut_user);
+	vsi->rss_lut_user = NULL;
+}
+
+/**
  * i40evf_watchdog_timer - Periodic call-back timer
  * @data: pointer to adapter disguised as unsigned long
  **/
@@ -2770,6 +2798,9 @@ static void i40evf_remove(struct pci_dev *pdev)
 
 	flush_scheduled_work();
 
+	/* Clear user configurations for RSS */
+	i40evf_clear_rss_config_user(&adapter->vsi);
+
 	if (hw->aq.asq.count)
 		i40evf_shutdown_adminq(hw);
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (7 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:28   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message Catherine Sullivan
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch fixes an issue where adminq init failures always provided
a message that NVM was newer than expected.  This is not always the
case for init_adminq failures. Without this patch, if adminq init
fails for any reason, newer nvm message would be given.  This
problem is fixed by adding  a check for that specific error
condition and a different hopefully helpful message otherwise.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Change-ID: Iaeaebee4e398989eae40bb70f943ab66a3a521a5

---
Testing-hints: This was only seen with SOME bricked cards. If you have one
that happens to work, you will see an erroneous error message that the
firmware is too new. If you cannot find a card that will reproduce the
error, a simple compile and check that the code is there is sufficient.
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 491c82f..508cf9a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10471,6 +10471,16 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	pf->hw.fc.requested_mode = I40E_FC_NONE;
 
 	err = i40e_init_adminq(hw);
+	if (err) {
+		if (err == I40E_ERR_FIRMWARE_API_VERSION)
+			dev_info(&pdev->dev,
+				 "The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n");
+		else
+			dev_info(&pdev->dev,
+				 "The driver for the device stopped because the device firmware failed to init. Try updating your NVM image.\n");
+
+		goto err_pf_reset;
+	}
 
 	/* provide nvm, fw, api versions */
 	dev_info(&pdev->dev, "fw %d.%d.%05d api %d.%d nvm %s\n",
@@ -10478,12 +10488,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		 hw->aq.api_maj_ver, hw->aq.api_min_ver,
 		 i40e_nvm_version_str(hw));
 
-	if (err) {
-		dev_info(&pdev->dev,
-			 "The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n");
-		goto err_pf_reset;
-	}
-
 	if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
 	    hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR)
 		dev_info(&pdev->dev,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (8 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:32   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful Catherine Sullivan
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Helin Zhang <helin.zhang@intel.com>

This patch fixes the confusing kernel message of enabled RSS size,
by reporting it together with the hardware maximum RSS size.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: I64864dbfbc13beccc180a7871680def1f3d5a339

---
Testing-hints: Check for "RSS count/HW max RSS count" in dmesg when the
RSS size is changed through "ethtool -l ethx", especially when the
number of queues are brought down.
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 508cf9a..4e9d6e5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8110,7 +8110,8 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 
 		i40e_pf_config_rss(pf);
 	}
-	dev_info(&pf->pdev->dev, "RSS count:  %d\n", pf->alloc_rss_size);
+	dev_info(&pf->pdev->dev, "RSS count/HW max RSS count:  %d/%d\n",
+		 pf->alloc_rss_size, pf->rss_size_max);
 	return pf->alloc_rss_size;
 }
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (9 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:34   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore Catherine Sullivan
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Mitch Williams <mitch.a.williams@intel.com>

If we get an invalid message from a VF, we should tell the user which VF
is being naughty, rather than making them guess.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I9252cef7baea3d8584043ed6ff12619a94e2f99c

---
Testing-hints: It is difficult to reproduce the error so just make sure
it compiles.
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 9c54ca2..26f247d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1094,8 +1094,8 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
 	/* single place to detect unsuccessful return values */
 	if (v_retval) {
 		vf->num_invalid_msgs++;
-		dev_err(&pf->pdev->dev, "Failed opcode %d Error: %d\n",
-			v_opcode, v_retval);
+		dev_err(&pf->pdev->dev, "VF %d failed opcode %d, error: %d\n",
+			vf->vf_id, v_opcode, v_retval);
 		if (vf->num_invalid_msgs >
 		    I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED) {
 			dev_err(&pf->pdev->dev,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (10 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:36   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically Catherine Sullivan
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Mitch Williams <mitch.a.williams@intel.com>

If, upon a midnight dreary, the PF returns ERR_PARAM when the VF is
requesting resources, that's fatal. Either the firmware or NVM is badly,
badly misconfigured, or this VF has been disabled due to a previous VF
driver sending a bunch of bogus messages.

Either way, there is no recovery from this. Don't ponder weak and weary,
just quit.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I09d9f16cc4ee7fec3b57646a289d33838c1c5bf5

---
Testing-hints: Ensure that the VF driver loads and initializes
correctly.
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 52a3286..f5d6932 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2435,6 +2435,14 @@ static void i40evf_init_task(struct work_struct *work)
 		if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) {
 			err = i40evf_send_vf_config_msg(adapter);
 			goto err;
+		} else if (err == I40E_ERR_PARAM) {
+			/* We only get ERR_PARAM if the device is in a very bad
+			 * state or if we've been disabled for previous bad
+			 * behavior. Either way, we're done now.
+			 */
+			i40evf_shutdown_adminq(hw);
+			dev_err(&pdev->dev, "Unable to get VF config due to PF error condition, not retrying\n");
+			return;
 		}
 		if (err) {
 			dev_err(&pdev->dev, "Unable to get VF config (%d)\n",
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (11 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:49   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically Catherine Sullivan
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Mitch Williams <mitch.a.williams@intel.com>

Change the queue_vector array from a statically-sized member of the
adapter structure to a dynamically-allocated and -sized array.

This reduces the size of the adapter structure, and allows us to support
any number of queue vectors in the future without changing the code.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I08dc622cb2f2ad01e832e51c1ad9b86524730693

---
Testing-hints: Open and close the interface several times and ensure
that traffic continues to pass.
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  5 +--
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 38 ++++++++++------------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  2 +-
 4 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index 090c604..bd185ad 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -145,9 +145,6 @@ struct i40e_q_vector {
 #define OTHER_VECTOR 1
 #define NONQ_VECS (OTHER_VECTOR)
 
-#define MAX_MSIX_Q_VECTORS 4
-#define MAX_MSIX_COUNT 5
-
 #define MIN_MSIX_Q_VECTORS 1
 #define MIN_MSIX_COUNT (MIN_MSIX_Q_VECTORS + NONQ_VECS)
 
@@ -193,7 +190,7 @@ struct i40evf_adapter {
 	struct work_struct reset_task;
 	struct work_struct adminq_task;
 	struct delayed_work init_task;
-	struct i40e_q_vector *q_vector[MAX_MSIX_Q_VECTORS];
+	struct i40e_q_vector *q_vectors;
 	struct list_head vlan_filter_list;
 	char misc_vector_name[IFNAMSIZ + 9];
 	int num_active_queues;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 4f4e5a3..ec059b3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -351,7 +351,7 @@ static int i40evf_set_coalesce(struct net_device *netdev,
 		vsi->tx_itr_setting &= ~I40E_ITR_DYNAMIC;
 
 	for (i = 0; i < adapter->num_msix_vectors - NONQ_VECS; i++) {
-		q_vector = adapter->q_vector[i];
+		q_vector = &adapter->q_vectors[i];
 		q_vector->rx.itr = ITR_TO_REG(vsi->rx_itr_setting);
 		wr32(hw, I40E_VFINT_ITRN1(0, i), q_vector->rx.itr);
 		q_vector->tx.itr = ITR_TO_REG(vsi->tx_itr_setting);
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index f5d6932..d12bd56 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -347,7 +347,7 @@ static irqreturn_t i40evf_msix_clean_rings(int irq, void *data)
 static void
 i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)
 {
-	struct i40e_q_vector *q_vector = adapter->q_vector[v_idx];
+	struct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];
 	struct i40e_ring *rx_ring = adapter->rx_rings[r_idx];
 
 	rx_ring->q_vector = q_vector;
@@ -368,7 +368,7 @@ i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)
 static void
 i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)
 {
-	struct i40e_q_vector *q_vector = adapter->q_vector[v_idx];
+	struct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];
 	struct i40e_ring *tx_ring = adapter->tx_rings[t_idx];
 
 	tx_ring->q_vector = q_vector;
@@ -464,7 +464,7 @@ static void i40evf_netpoll(struct net_device *netdev)
 		return;
 
 	for (i = 0; i < q_vectors; i++)
-		i40evf_msix_clean_rings(0, adapter->q_vector[i]);
+		i40evf_msix_clean_rings(0, &adapter->q_vectors[i]);
 }
 
 #endif
@@ -486,7 +486,7 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 	q_vectors = adapter->num_msix_vectors - NONQ_VECS;
 
 	for (vector = 0; vector < q_vectors; vector++) {
-		struct i40e_q_vector *q_vector = adapter->q_vector[vector];
+		struct i40e_q_vector *q_vector = &adapter->q_vectors[vector];
 
 		if (q_vector->tx.ring && q_vector->rx.ring) {
 			snprintf(q_vector->name, sizeof(q_vector->name) - 1,
@@ -531,7 +531,7 @@ free_queue_irqs:
 			adapter->msix_entries[vector + NONQ_VECS].vector,
 			NULL);
 		free_irq(adapter->msix_entries[vector + NONQ_VECS].vector,
-			 adapter->q_vector[vector]);
+			 &adapter->q_vectors[vector]);
 	}
 	return err;
 }
@@ -581,7 +581,7 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)
 		irq_set_affinity_hint(adapter->msix_entries[i+1].vector,
 				      NULL);
 		free_irq(adapter->msix_entries[i+1].vector,
-			 adapter->q_vector[i]);
+			 &adapter->q_vectors[i]);
 	}
 }
 
@@ -953,7 +953,7 @@ static void i40evf_napi_enable_all(struct i40evf_adapter *adapter)
 	for (q_idx = 0; q_idx < q_vectors; q_idx++) {
 		struct napi_struct *napi;
 
-		q_vector = adapter->q_vector[q_idx];
+		q_vector = &adapter->q_vectors[q_idx];
 		napi = &q_vector->napi;
 		napi_enable(napi);
 	}
@@ -970,7 +970,7 @@ static void i40evf_napi_disable_all(struct i40evf_adapter *adapter)
 	int q_vectors = adapter->num_msix_vectors - NONQ_VECS;
 
 	for (q_idx = 0; q_idx < q_vectors; q_idx++) {
-		q_vector = adapter->q_vector[q_idx];
+		q_vector = &adapter->q_vectors[q_idx];
 		napi_disable(&q_vector->napi);
 	}
 }
@@ -1483,21 +1483,22 @@ static int i40evf_init_rss(struct i40evf_adapter *adapter)
  **/
 static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
 {
-	int q_idx, num_q_vectors;
+	int q_idx = 0, num_q_vectors;
 	struct i40e_q_vector *q_vector;
 
 	num_q_vectors = adapter->num_msix_vectors - NONQ_VECS;
+	adapter->q_vectors = kzalloc(sizeof(*q_vector) * num_q_vectors,
+				     GFP_KERNEL);
+	if (!adapter->q_vectors)
+		goto err_out;
 
 	for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
-		q_vector = kzalloc(sizeof(*q_vector), GFP_KERNEL);
-		if (!q_vector)
-			goto err_out;
+		q_vector = &adapter->q_vectors[q_idx];
 		q_vector->adapter = adapter;
 		q_vector->vsi = &adapter->vsi;
 		q_vector->v_idx = q_idx;
 		netif_napi_add(adapter->netdev, &q_vector->napi,
 			       i40evf_napi_poll, NAPI_POLL_WEIGHT);
-		adapter->q_vector[q_idx] = q_vector;
 	}
 
 	return 0;
@@ -1505,11 +1506,10 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
 err_out:
 	while (q_idx) {
 		q_idx--;
-		q_vector = adapter->q_vector[q_idx];
+		q_vector = &adapter->q_vectors[q_idx];
 		netif_napi_del(&q_vector->napi);
-		kfree(q_vector);
-		adapter->q_vector[q_idx] = NULL;
 	}
+	kfree(adapter->q_vectors);
 	return -ENOMEM;
 }
 
@@ -1530,13 +1530,11 @@ static void i40evf_free_q_vectors(struct i40evf_adapter *adapter)
 	napi_vectors = adapter->num_active_queues;
 
 	for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
-		struct i40e_q_vector *q_vector = adapter->q_vector[q_idx];
-
-		adapter->q_vector[q_idx] = NULL;
+		struct i40e_q_vector *q_vector = &adapter->q_vectors[q_idx];
 		if (q_idx < napi_vectors)
 			netif_napi_del(&q_vector->napi);
-		kfree(q_vector);
 	}
+	kfree(adapter->q_vectors);
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 46b0516..24b3af3 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -360,7 +360,7 @@ void i40evf_map_queues(struct i40evf_adapter *adapter)
 	vimi->num_vectors = adapter->num_msix_vectors;
 	/* Queue vectors first */
 	for (v_idx = 0; v_idx < q_vectors; v_idx++) {
-		q_vector = adapter->q_vector[v_idx];
+		q_vector = adapter->q_vectors + v_idx;
 		vimi->vecmap[v_idx].vsi_id = adapter->vsi_res->vsi_id;
 		vimi->vecmap[v_idx].vector_id = v_idx + NONQ_VECS;
 		vimi->vecmap[v_idx].txq_map = q_vector->ring_mask;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (12 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 21:58   ` Bowers, AndrewX
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1 Catherine Sullivan
  2015-10-27 20:16 ` [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Sullivan, Catherine
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

From: Mitch Williams <mitch.a.williams@intel.com>

Instead of awkwardly keeping a fixed array of pointers in the adapter
struct and then allocating ring structs individually, just keep a single
pointer and allocate a single blob for the arrays. This simplifies code,
shrinks the adapter structure, and future-proofs the driver by not
limiting the number of rings we can handle.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I31334ff911a6474954232cfe4bc98ccca3c769ff

---
Testing-hints: Ensure the driver loads and passes traffic, and unloads
properly.
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c      |  2 +-
 drivers/net/ethernet/intel/i40evf/i40evf.h         |  4 +-
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  8 +--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 57 +++++++++++-----------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    | 10 ++--
 5 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 35fc721..3725744 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -2064,7 +2064,7 @@ out_drop:
 netdev_tx_t i40evf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
-	struct i40e_ring *tx_ring = adapter->tx_rings[skb->queue_mapping];
+	struct i40e_ring *tx_ring = &adapter->tx_rings[skb->queue_mapping];
 
 	/* hardware can't handle really short frames, hardware padding works
 	 * beyond this point
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index bd185ad..a6318c4 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -196,13 +196,13 @@ struct i40evf_adapter {
 	int num_active_queues;
 
 	/* TX */
-	struct i40e_ring *tx_rings[I40E_MAX_VSI_QP];
+	struct i40e_ring *tx_rings;
 	u32 tx_timeout_count;
 	struct list_head mac_filter_list;
 	u32 tx_desc_count;
 
 	/* RX */
-	struct i40e_ring *rx_rings[I40E_MAX_VSI_QP];
+	struct i40e_ring *rx_rings;
 	u64 hw_csum_rx_error;
 	u32 rx_desc_count;
 	int num_msix_vectors;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index ec059b3..2e5c940 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -121,12 +121,12 @@ static void i40evf_get_ethtool_stats(struct net_device *netdev,
 		data[i] =  *(u64 *)p;
 	}
 	for (j = 0; j < adapter->num_active_queues; j++) {
-		data[i++] = adapter->tx_rings[j]->stats.packets;
-		data[i++] = adapter->tx_rings[j]->stats.bytes;
+		data[i++] = adapter->tx_rings[j].stats.packets;
+		data[i++] = adapter->tx_rings[j].stats.bytes;
 	}
 	for (j = 0; j < adapter->num_active_queues; j++) {
-		data[i++] = adapter->rx_rings[j]->stats.packets;
-		data[i++] = adapter->rx_rings[j]->stats.bytes;
+		data[i++] = adapter->rx_rings[j].stats.packets;
+		data[i++] = adapter->rx_rings[j].stats.bytes;
 	}
 }
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d12bd56..67a2b47 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -348,7 +348,7 @@ static void
 i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)
 {
 	struct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];
-	struct i40e_ring *rx_ring = adapter->rx_rings[r_idx];
+	struct i40e_ring *rx_ring = &adapter->rx_rings[r_idx];
 
 	rx_ring->q_vector = q_vector;
 	rx_ring->next = q_vector->rx.ring;
@@ -369,7 +369,7 @@ static void
 i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)
 {
 	struct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];
-	struct i40e_ring *tx_ring = adapter->tx_rings[t_idx];
+	struct i40e_ring *tx_ring = &adapter->tx_rings[t_idx];
 
 	tx_ring->q_vector = q_vector;
 	tx_ring->next = q_vector->tx.ring;
@@ -610,7 +610,7 @@ static void i40evf_configure_tx(struct i40evf_adapter *adapter)
 	int i;
 
 	for (i = 0; i < adapter->num_active_queues; i++)
-		adapter->tx_rings[i]->tail = hw->hw_addr + I40E_QTX_TAIL1(i);
+		adapter->tx_rings[i].tail = hw->hw_addr + I40E_QTX_TAIL1(i);
 }
 
 /**
@@ -655,8 +655,8 @@ static void i40evf_configure_rx(struct i40evf_adapter *adapter)
 	}
 
 	for (i = 0; i < adapter->num_active_queues; i++) {
-		adapter->rx_rings[i]->tail = hw->hw_addr + I40E_QRX_TAIL1(i);
-		adapter->rx_rings[i]->rx_buf_len = rx_buf_len;
+		adapter->rx_rings[i].tail = hw->hw_addr + I40E_QRX_TAIL1(i);
+		adapter->rx_rings[i].rx_buf_len = rx_buf_len;
 	}
 }
 
@@ -991,7 +991,7 @@ static void i40evf_configure(struct i40evf_adapter *adapter)
 	adapter->aq_required |= I40EVF_FLAG_AQ_CONFIGURE_QUEUES;
 
 	for (i = 0; i < adapter->num_active_queues; i++) {
-		struct i40e_ring *ring = adapter->rx_rings[i];
+		struct i40e_ring *ring = &adapter->rx_rings[i];
 
 		i40evf_alloc_rx_buffers_1buf(ring, ring->count);
 		ring->next_to_use = ring->count - 1;
@@ -1111,16 +1111,10 @@ i40evf_acquire_msix_vectors(struct i40evf_adapter *adapter, int vectors)
  **/
 static void i40evf_free_queues(struct i40evf_adapter *adapter)
 {
-	int i;
-
 	if (!adapter->vsi_res)
 		return;
-	for (i = 0; i < adapter->num_active_queues; i++) {
-		if (adapter->tx_rings[i])
-			kfree_rcu(adapter->tx_rings[i], rcu);
-		adapter->tx_rings[i] = NULL;
-		adapter->rx_rings[i] = NULL;
-	}
+	kfree(adapter->tx_rings);
+	kfree(adapter->rx_rings);
 }
 
 /**
@@ -1135,13 +1129,20 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
 {
 	int i;
 
+	adapter->tx_rings = kcalloc(adapter->num_active_queues,
+				    sizeof(struct i40e_ring), GFP_KERNEL);
+	if (!adapter->tx_rings)
+		goto err_out;
+	adapter->rx_rings = kcalloc(adapter->num_active_queues,
+				    sizeof(struct i40e_ring), GFP_KERNEL);
+	if (!adapter->rx_rings)
+		goto err_out;
+
 	for (i = 0; i < adapter->num_active_queues; i++) {
 		struct i40e_ring *tx_ring;
 		struct i40e_ring *rx_ring;
 
-		tx_ring = kzalloc(sizeof(*tx_ring) * 2, GFP_KERNEL);
-		if (!tx_ring)
-			goto err_out;
+		tx_ring = &adapter->tx_rings[i];
 
 		tx_ring->queue_index = i;
 		tx_ring->netdev = adapter->netdev;
@@ -1149,14 +1150,12 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
 		tx_ring->count = adapter->tx_desc_count;
 		if (adapter->flags & I40E_FLAG_WB_ON_ITR_CAPABLE)
 			tx_ring->flags |= I40E_TXR_FLAGS_WB_ON_ITR;
-		adapter->tx_rings[i] = tx_ring;
 
-		rx_ring = &tx_ring[1];
+		rx_ring = &adapter->rx_rings[i];
 		rx_ring->queue_index = i;
 		rx_ring->netdev = adapter->netdev;
 		rx_ring->dev = &adapter->pdev->dev;
 		rx_ring->count = adapter->rx_desc_count;
-		adapter->rx_rings[i] = rx_ring;
 	}
 
 	return 0;
@@ -1487,7 +1486,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
 	struct i40e_q_vector *q_vector;
 
 	num_q_vectors = adapter->num_msix_vectors - NONQ_VECS;
-	adapter->q_vectors = kzalloc(sizeof(*q_vector) * num_q_vectors,
+	adapter->q_vectors = kcalloc(num_q_vectors, sizeof(*q_vector),
 				     GFP_KERNEL);
 	if (!adapter->q_vectors)
 		goto err_out;
@@ -2035,8 +2034,8 @@ void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter)
 	int i;
 
 	for (i = 0; i < adapter->num_active_queues; i++)
-		if (adapter->tx_rings[i]->desc)
-			i40evf_free_tx_resources(adapter->tx_rings[i]);
+		if (adapter->tx_rings[i].desc)
+			i40evf_free_tx_resources(&adapter->tx_rings[i]);
 }
 
 /**
@@ -2054,8 +2053,8 @@ static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter)
 	int i, err = 0;
 
 	for (i = 0; i < adapter->num_active_queues; i++) {
-		adapter->tx_rings[i]->count = adapter->tx_desc_count;
-		err = i40evf_setup_tx_descriptors(adapter->tx_rings[i]);
+		adapter->tx_rings[i].count = adapter->tx_desc_count;
+		err = i40evf_setup_tx_descriptors(&adapter->tx_rings[i]);
 		if (!err)
 			continue;
 		dev_err(&adapter->pdev->dev,
@@ -2081,8 +2080,8 @@ static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter)
 	int i, err = 0;
 
 	for (i = 0; i < adapter->num_active_queues; i++) {
-		adapter->rx_rings[i]->count = adapter->rx_desc_count;
-		err = i40evf_setup_rx_descriptors(adapter->rx_rings[i]);
+		adapter->rx_rings[i].count = adapter->rx_desc_count;
+		err = i40evf_setup_rx_descriptors(&adapter->rx_rings[i]);
 		if (!err)
 			continue;
 		dev_err(&adapter->pdev->dev,
@@ -2103,8 +2102,8 @@ void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter)
 	int i;
 
 	for (i = 0; i < adapter->num_active_queues; i++)
-		if (adapter->rx_rings[i]->desc)
-			i40evf_free_rx_resources(adapter->rx_rings[i]);
+		if (adapter->rx_rings[i].desc)
+			i40evf_free_rx_resources(&adapter->rx_rings[i]);
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 24b3af3..9b55576 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -255,19 +255,19 @@ void i40evf_configure_queues(struct i40evf_adapter *adapter)
 	for (i = 0; i < pairs; i++) {
 		vqpi->txq.vsi_id = vqci->vsi_id;
 		vqpi->txq.queue_id = i;
-		vqpi->txq.ring_len = adapter->tx_rings[i]->count;
-		vqpi->txq.dma_ring_addr = adapter->tx_rings[i]->dma;
+		vqpi->txq.ring_len = adapter->tx_rings[i].count;
+		vqpi->txq.dma_ring_addr = adapter->tx_rings[i].dma;
 		vqpi->txq.headwb_enabled = 1;
 		vqpi->txq.dma_headwb_addr = vqpi->txq.dma_ring_addr +
 		    (vqpi->txq.ring_len * sizeof(struct i40e_tx_desc));
 
 		vqpi->rxq.vsi_id = vqci->vsi_id;
 		vqpi->rxq.queue_id = i;
-		vqpi->rxq.ring_len = adapter->rx_rings[i]->count;
-		vqpi->rxq.dma_ring_addr = adapter->rx_rings[i]->dma;
+		vqpi->rxq.ring_len = adapter->rx_rings[i].count;
+		vqpi->rxq.dma_ring_addr = adapter->rx_rings[i].dma;
 		vqpi->rxq.max_pkt_size = adapter->netdev->mtu
 					+ ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN;
-		vqpi->rxq.databuffer_size = adapter->rx_rings[i]->rx_buf_len;
+		vqpi->rxq.databuffer_size = adapter->rx_rings[i].rx_buf_len;
 		vqpi++;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (13 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically Catherine Sullivan
@ 2015-10-26 23:44 ` Catherine Sullivan
  2015-10-28 22:00   ` Bowers, AndrewX
  2015-10-27 20:16 ` [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Sullivan, Catherine
  15 siblings, 1 reply; 32+ messages in thread
From: Catherine Sullivan @ 2015-10-26 23:44 UTC (permalink / raw)
  To: intel-wired-lan

Bump.

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Change-ID: I00ebbb2e5e5572f947502b8f6db4d94f666d6b14
---
 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(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4e9d6e5..7759703 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 4
-#define DRV_VERSION_BUILD 2
+#define DRV_VERSION_BUILD 4
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 67a2b47..0776e67 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -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.33"
+#define DRV_VERSION "1.4.1"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2015 Intel Corporation.";
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config rss function
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config " Catherine Sullivan
@ 2015-10-27 20:16   ` Sullivan, Catherine
  0 siblings, 0 replies; 32+ messages in thread
From: Sullivan, Catherine @ 2015-10-27 20:16 UTC (permalink / raw)
  To: intel-wired-lan

v2 with fixed spelling sent.


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates
  2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
                   ` (14 preceding siblings ...)
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1 Catherine Sullivan
@ 2015-10-27 20:16 ` Sullivan, Catherine
  15 siblings, 0 replies; 32+ messages in thread
From: Sullivan, Catherine @ 2015-10-27 20:16 UTC (permalink / raw)
  To: intel-wired-lan

v2 with fixed spelling sent.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround Catherine Sullivan
@ 2015-10-28 19:26   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 19:26 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:44 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit
> update in Tx path and disable force WB workaround
> 
> From: Anjali Singhai Jain <anjali.singhai@intel.com>
> 
> This patch fixes the issue of forcing WB too often causing us to not benefit
> from NAPI.
> 
> Without this patch we were forcing WB/arming interrupt too often taking
> away the benefits of NAPI and causing a performance impact.
> 
> With this patch we disable force WB in the clean routine for X710 and XL710
> adapters. X722 adapters do not enable interrupt to force a WB and benefit
> from WB_ON_ITR and hence force WB is left enabled for those adapters.
> For XL710 and X710 adapters if we have less than 4 packets pending a
> software Interrupt triggered from service task will force a WB.
> 
> This patch also changes the conditions for setting RS bit as described in code
> comments. This optimizes when the HW does a tail bump amd when it does a
> WB. It also optimizes when we do a wmb.
> 
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> Change-ID: Id831e1ae7d3e2ec3f52cd0917b41ce1d22d75d9d
> 
> ---
> Testing-hints: Test with heavy receive side traffic and you should see a lower
> interrupt rate, lower CPU utilization, lower packet latency, and higher
> transmit throughput.
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 118 ++++++++++++++++----
> ------
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.h |   2 +
>  2 files changed, 77 insertions(+), 43 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, lower cpu utilization, lower latency, and higher throughput seen with patch applied.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function Catherine Sullivan
@ 2015-10-28 20:08   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 20:08 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter
> specific rss function
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> This patch renames old VF adapter specific rss function to clarify its scope.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: Ie5253083a44c677ebb7709a8a3a18402ad2dc6a6
> 
> ---
> Testing-hints: Test compile only, no functional change.
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit Catherine Sullivan
@ 2015-10-28 21:01   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:01 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb
> data on transmit
> 
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
> 
> Issue a prefetch for data early in the transmit path.
> This should not be generally needed for tx traffic, but it helps immensely for
> pktgen workloads and should help for forwarding workloads as well.
> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Change-ID: Iefee870c20599e0c4240e1d8637e4f16b625f83a
> 
> ---
> Testing-hints: Run transmit traffic UDP and TCP to make sure there is not a
> performance (CPU utilization) increase. Run pktgen (Jesse has helper script
> available) to see the performance increases with the patch when sending 64
> byte packets. For bonus points could test forwarding workload for
> performance improvement.
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 3 +++
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 +++
>  2 files changed, 6 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, performance increase seen with iperf3, and with pktgen script

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get rss function
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get " Catherine Sullivan
@ 2015-10-28 21:21   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:21 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get
> rss function
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> There are two ways to get RSS, this patch implements two functions with the
> same input parameters, and creates a more generic function for getting RSS
> configuration.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: I12d3b712c21455d47dd0a5aae58fc9b7c680db59
> 
> ---
> Testing-hints: Test RSS still works right on multiple RX queues in the VF (via
> testing multiple flows RX). Test setting RSS indirection table via ethtool -X,
> and reading via ethtool -x works.
>  drivers/net/ethernet/intel/i40evf/i40evf.h         |  2 +
>  drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 35 +++++---
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 97
> ++++++++++++++++++++++
>  3 files changed, 121 insertions(+), 13 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, ethtool -x and -X work correctly, able to use RSS with multiple RX queues in VF

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS Catherine Sullivan
@ 2015-10-28 21:25   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:25 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to
> store user configuration of RSS
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> This patch adds new fields to i40e_vsi to store user configured RSS config
> data and code to use it.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: Ic5d3db8d9df52182b560248f8cdca9c5c7546879
> 
> ---
> Testing-hints: Test ethtool -x and ethtool -X work correctly on VF.
> After VF reset, user configured settings via ethtool -X should be restored.
>  drivers/net/ethernet/intel/i40evf/i40evf.h         |  2 ++
>  drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 31 ++++++++++--------
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 37
> ++++++++++++++++++++--
>  3 files changed, 54 insertions(+), 16 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, ethtool -x and -X work on VF, settings persist across reset.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging Catherine Sullivan
@ 2015-10-28 21:28   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:28 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error
> messaging
> 
> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
> 
> This patch fixes an issue where adminq init failures always provided a
> message that NVM was newer than expected.  This is not always the case for
> init_adminq failures. Without this patch, if adminq init fails for any reason,
> newer nvm message would be given.  This problem is fixed by adding  a
> check for that specific error condition and a different hopefully helpful
> message otherwise.
> 
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Change-ID: Iaeaebee4e398989eae40bb70f943ab66a3a521a5
> 
> ---
> Testing-hints: This was only seen with SOME bricked cards. If you have one
> that happens to work, you will see an erroneous error message that the
> firmware is too new. If you cannot find a card that will reproduce the error, a
> simple compile and check that the code is there is sufficient.
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message Catherine Sullivan
@ 2015-10-28 21:32   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:32 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> This patch fixes the confusing kernel message of enabled RSS size, by
> reporting it together with the hardware maximum RSS size.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: I64864dbfbc13beccc180a7871680def1f3d5a339
> 
> ---
> Testing-hints: Check for "RSS count/HW max RSS count" in dmesg when the
> RSS size is changed through "ethtool -l ethx", especially when the number of
> queues are brought down.
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, updated message appears in dmesg when changing RSS queue size.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful Catherine Sullivan
@ 2015-10-28 21:34   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:34 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message
> more useful
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> If we get an invalid message from a VF, we should tell the user which VF is
> being naughty, rather than making them guess.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I9252cef7baea3d8584043ed6ff12619a94e2f99c
> 
> ---
> Testing-hints: It is difficult to reproduce the error so just make sure it
> compiles.
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore Catherine Sullivan
@ 2015-10-28 21:36   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:36 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver,
> Nevermore
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> If, upon a midnight dreary, the PF returns ERR_PARAM when the VF is
> requesting resources, that's fatal. Either the firmware or NVM is badly, badly
> misconfigured, or this VF has been disabled due to a previous VF driver
> sending a bunch of bogus messages.
> 
> Either way, there is no recovery from this. Don't ponder weak and weary,
> just quit.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I09d9f16cc4ee7fec3b57646a289d33838c1c5bf5
> 
> ---
> Testing-hints: Ensure that the VF driver loads and initializes correctly.
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, i40evf driver loads and initializes correctly

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically Catherine Sullivan
@ 2015-10-28 21:49   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:49 UTC (permalink / raw)
  To: intel-wired-lan

>  -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue
> vectors dynamically
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> Change the queue_vector array from a statically-sized member of the
> adapter structure to a dynamically-allocated and -sized array.
> 
> This reduces the size of the adapter structure, and allows us to support any
> number of queue vectors in the future without changing the code.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I08dc622cb2f2ad01e832e51c1ad9b86524730693
> 
> ---
> Testing-hints: Open and close the interface several times and ensure that
> traffic continues to pass.
>  drivers/net/ethernet/intel/i40evf/i40evf.h         |  5 +--
>  drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  2 +-
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 38 ++++++++++----------
> --
>  .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  2 +-
>  4 files changed, 21 insertions(+), 26 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, interface passes traffic after opening and closing interface

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically Catherine Sullivan
@ 2015-10-28 21:58   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 21:58 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs
> dynamically
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> Instead of awkwardly keeping a fixed array of pointers in the adapter struct
> and then allocating ring structs individually, just keep a single pointer and
> allocate a single blob for the arrays. This simplifies code, shrinks the adapter
> structure, and future-proofs the driver by not limiting the number of rings
> we can handle.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I31334ff911a6474954232cfe4bc98ccca3c769ff
> 
> ---
> Testing-hints: Ensure the driver loads and passes traffic, and unloads
> properly.
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c      |  2 +-
>  drivers/net/ethernet/intel/i40evf/i40evf.h         |  4 +-
>  drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  8 +--
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 57 +++++++++++--------
> ---
>  .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    | 10 ++--
>  5 files changed, 40 insertions(+), 41 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, driver loads and unloads properly and passes traffic.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1 Catherine Sullivan
@ 2015-10-28 22:00   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-28 22:00 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:45 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e
> version to 1.4.4 and i40evf to 1.4.1
> 
> Bump.
> 
> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> Change-ID: I00ebbb2e5e5572f947502b8f6db4d94f666d6b14
> ---
>  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(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, modinfo shows correct driver version, driver shows correct version on init.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion Catherine Sullivan
@ 2015-10-29 21:59   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-29 21:59 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:44 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to
> store user configuraion
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> This patch adds new fields to i40e_vsi to store user configured RSS config
> data and code to use it.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: I73886469dca9e9f6b16d842182a87f3f4009f95d
> 
> ---
> Testing-hints: Test with the next patch.
>  drivers/net/ethernet/intel/i40e/i40e.h         |  2 +
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 +++++++++------
>  drivers/net/ethernet/intel/i40e/i40e_main.c    | 52
> +++++++++++++++++++++++---
>  3 files changed, 68 insertions(+), 17 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, ethtool -x/X and -l/L show and set correct data, data persists across resets.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf
  2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf Catherine Sullivan
@ 2015-10-29 21:59   ` Bowers, AndrewX
  0 siblings, 0 replies; 32+ messages in thread
From: Bowers, AndrewX @ 2015-10-29 21:59 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Catherine Sullivan
> Sent: Monday, October 26, 2015 4:44 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Zhang, Helin
> Subject: [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to
> alloc_rss_size in i40e_pf
> 
> From: Helin Zhang <helin.zhang@intel.com>
> 
> This patch renames rss_size to alloc_rss_size in i40e_pf, which is clearer and
> avoids confusion. It also adds comments to the other related structure
> members to help clarify usage.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Change-ID: Ia90090609d006ab589cb639975bb8a0af795d16f
> 
> ---
> Testing-hints: Test all the RSS knobs from ethtool for X[L]710 and X722.
>  drivers/net/ethernet/intel/i40e/i40e.h      |  8 ++++----
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 31 +++++++++++++++++-----
> -------
>  2 files changed, 22 insertions(+), 17 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, ethtool -x/X and -l/L show and set correct data, data persists across resets.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-10-29 21:59 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 23:44 [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Catherine Sullivan
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 01/15] i40e: add new fields to store user configuraion Catherine Sullivan
2015-10-29 21:59   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 02/15] i40e: rename rss_size to alloc_rss_size in i40e_pf Catherine Sullivan
2015-10-29 21:59   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 03/15] i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround Catherine Sullivan
2015-10-28 19:26   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 04/15] i40e/i40evf: prefetch skb data on transmit Catherine Sullivan
2015-10-28 21:01   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 05/15] i40evf: rename vf adapter specific rss function Catherine Sullivan
2015-10-28 20:08   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 06/15] i40evf: create a generic config " Catherine Sullivan
2015-10-27 20:16   ` Sullivan, Catherine
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 07/15] i40evf: create a generic get " Catherine Sullivan
2015-10-28 21:21   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 08/15] i40evf: add new fields to store user configuration of RSS Catherine Sullivan
2015-10-28 21:25   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 09/15] i40e: Update error messaging Catherine Sullivan
2015-10-28 21:28   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 10/15] i40e: fix confusing message Catherine Sullivan
2015-10-28 21:32   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 11/15] i40e: make error message more useful Catherine Sullivan
2015-10-28 21:34   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 12/15] i40evf: quoth the VF driver, Nevermore Catherine Sullivan
2015-10-28 21:36   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue vectors dynamically Catherine Sullivan
2015-10-28 21:49   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 14/15] i40evf: allocate ring structs dynamically Catherine Sullivan
2015-10-28 21:58   ` Bowers, AndrewX
2015-10-26 23:44 ` [Intel-wired-lan] [next PATCH S20 15/15] i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1 Catherine Sullivan
2015-10-28 22:00   ` Bowers, AndrewX
2015-10-27 20:16 ` [Intel-wired-lan] [next PATCH S20 00/15] i40e/i40evf updates Sullivan, Catherine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.