Skip to contentSkip to conversation

i40e/i40evf updates

PATCH Superseded Catherine Sullivan 2 participants 32 messages Oct 26, 2015 – Oct 29, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover i40e/i40evf updates

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(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/15 i40e: add new fields to store user configuraion

From: Helin Zhang <[email protected]>

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

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(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
index 89f5323..6efab66 100644
@@ -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;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +19 -12
index 6cb2b34..b52c509 100644
@@ -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);
 }
 
 /**
drivers/net/ethernet/intel/i40e/i40e_main.c +47 -5

88 lines not on this page · raw message

Signature · 1 line
1.9.3
#2 lore raw

PATCH 1/15 i40e: add new fields to store user configuraion

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, 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 <[email protected]>

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

Change-ID I73886469dca9e9f6b16d842182a87f3f4009f95d
Quoted 7 lines

---
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(-)

Patch code changes correctly applied, ethtool -x/X and -l/L show and set correct data, data persists across resets.

#3 lore raw

PATCH 2/15 i40e: rename rss_size to alloc_rss_size in i40e_pf

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40e/i40e.h +4 -4
index 6efab66..d854a46 100644
@@ -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 */
 
drivers/net/ethernet/intel/i40e/i40e_main.c +18 -13
index c0a784f..491c82f 100644
@@ -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
Signature · 1 line
1.9.3
#4 lore raw

PATCH 2/15 i40e: rename rss_size to alloc_rss_size in i40e_pf

Quoted 18 lines

-----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 <[email protected]>

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.

Change-ID Ia90090609d006ab589cb639975bb8a0af795d16f
Quoted 6 lines

---
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(-)

Patch code changes correctly applied, ethtool -x/X and -l/L show and set correct data, data persists across resets.

#5 lore raw

PATCH 3/15 i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround

In reply to Catherine Sullivan

From: Anjali Singhai Jain <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +75 -43
index f82c64a..a7f9840 100644
@@ -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:
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +2 -0
index 997b374..929ddd9 100644
@@ -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)
Signature · 1 line
1.9.3
#6 lore raw

PATCH 3/15 i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround

Quoted 29 lines

-----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 <[email protected]>

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.

Change-ID Id831e1ae7d3e2ec3f52cd0917b41ce1d22d75d9d
Quoted 8 lines

---
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(-)

Patch code changes correctly applied, lower cpu utilization, lower latency, and higher throughput seen with patch applied.

#7 lore raw

PATCH 4/15 i40e/i40evf: prefetch skb data on transmit

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

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.

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(+)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 -0
index 7e7d224..494e6ef 100644
@@ -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;
 
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +3 -0
index a7f9840..35fc721 100644
@@ -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;
 
Signature · 1 line
1.9.3
#8 lore raw

PATCH 4/15 i40e/i40evf: prefetch skb data on transmit

Quoted 23 lines

-----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 <[email protected]>

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.

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.

Quoted 3 lines
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 3 +++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 +++
 2 files changed, 6 insertions(+)

Patch code changes correctly applied, performance increase seen with iperf3, and with pktgen script

#9 lore raw

PATCH 5/15 i40evf: rename vf adapter specific rss function

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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

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(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +5 -5
index 506c08d..a8f67d3 100644
@@ -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:
Signature · 1 line
1.9.3
#10 lore raw

PATCH 5/15 i40evf: rename vf adapter specific rss function

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, 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 <[email protected]>

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

Quoted 7 lines
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(-)

Patch code changes correctly applied

#11 lore raw

PATCH 6/15 i40evf: create a generic config rss function

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +3 -0
index 22fc3d4..b5aa377 100644
@@ -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_ */
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +19 -10
index 4790437..fe1d1a3 100644
@@ -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 = {
drivers/net/ethernet/intel/i40evf/i40evf_main.c +108 -60

218 lines not on this page · raw message

Signature · 1 line
1.9.3
#12 lore raw

PATCH 6/15 i40evf: create a generic config rss function

v2 with fixed spelling sent.

#13 lore raw

PATCH 7/15 i40evf: create a generic get rss function

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +2 -0
index b5aa377..5f2e61d 100644
@@ -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_ */
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +22 -13
index fe1d1a3..0222e16 100644
@@ -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;
 }
 
 /**
drivers/net/ethernet/intel/i40evf/i40evf_main.c +97 -0

109 lines not on this page · raw message

Signature · 1 line
1.9.3
#14 lore raw

PATCH 7/15 i40evf: create a generic get rss function

Quoted 22 lines

-----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 <[email protected]>

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.

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.

Quoted 5 lines
 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(-)

Patch code changes correctly applied, ethtool -x and -X work correctly, able to use RSS with multiple RX queues in VF

#15 lore raw

PATCH 8/15 i40evf: add new fields to store user configuration of RSS

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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

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(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +2 -0
index 5f2e61d..090c604 100644
@@ -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 ? */
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +18 -13
index 0222e16..4f4e5a3 100644
@@ -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 = {
drivers/net/ethernet/intel/i40evf/i40evf_main.c +34 -3
index ae20d95..52a3286 100644
@@ -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);
 
Signature · 1 line
1.9.3
#16 lore raw

PATCH 8/15 i40evf: add new fields to store user configuration of RSS

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, 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 <[email protected]>

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

Change-ID Ic5d3db8d9df52182b560248f8cdca9c5c7546879
Quoted 8 lines

---
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(-)

Patch code changes correctly applied, ethtool -x and -X work on VF, settings persist across reset.

#17 lore raw

PATCH 9/15 i40e: Update error messaging

In reply to Catherine Sullivan

From: Carolyn Wyborny <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +10 -6
index 491c82f..508cf9a 100644
@@ -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,
Signature · 1 line
1.9.3
#18 lore raw

PATCH 9/15 i40e: Update error messaging

Quoted 20 lines

-----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 <[email protected]>

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.

Change-ID Iaeaebee4e398989eae40bb70f943ab66a3a521a5
Quoted 7 lines

---
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(-)

Patch code changes correctly applied

#19 lore raw

PATCH 10/15 i40e: fix confusing message

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

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

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(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -1
index 508cf9a..4e9d6e5 100644
@@ -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;
 }
 
Signature · 1 line
1.9.3
#20 lore raw

PATCH 10/15 i40e: fix confusing message

Quoted 16 lines

-----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 <[email protected]>

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

Change-ID I64864dbfbc13beccc180a7871680def1f3d5a339
Quoted 6 lines

---
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(-)

Patch code changes correctly applied, updated message appears in dmesg when changing RSS queue size.

#21 lore raw

PATCH 11/15 i40e: make error message more useful

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

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

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(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -2
index 9c54ca2..26f247d 100644
@@ -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,
Signature · 1 line
1.9.3
#22 lore raw

PATCH 11/15 i40e: make error message more useful

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, 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 <[email protected]>

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

Quoted 8 lines
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(-)

Patch code changes correctly applied

#23 lore raw

PATCH 12/15 i40evf: quoth the VF driver, Nevermore

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

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.

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(+)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +8 -0
index 52a3286..f5d6932 100644
@@ -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",
Signature · 1 line
1.9.3
#24 lore raw

PATCH 12/15 i40evf: quoth the VF driver, Nevermore

Quoted 18 lines

-----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 <[email protected]>

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.

Quoted 7 lines
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(+)

Patch code changes correctly applied, i40evf driver loads and initializes correctly

#25 lore raw

PATCH 13/15 i40evf: allocate queue vectors dynamically

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +1 -4
index 090c604..bd185ad 100644
@@ -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;
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +1 -1
index 4f4e5a3..ec059b3 100644
@@ -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);
drivers/net/ethernet/intel/i40evf/i40evf_main.c +18 -20
index f5d6932..d12bd56 100644
@@ -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);
 }
 
 /**
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +1 -1
index 46b0516..24b3af3 100644
@@ -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;
Signature · 1 line
1.9.3
#26 lore raw

PATCH 13/15 i40evf: allocate queue vectors dynamically

Quoted 22 lines

-----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 <[email protected]>

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.

Change-ID I08dc622cb2f2ad01e832e51c1ad9b86524730693

---
Testing-hints: Open and close the interface several times and ensure that traffic continues to pass.

Quoted 6 lines
 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(-)

Patch code changes correctly applied, interface passes traffic after opening and closing interface

#27 lore raw

PATCH 14/15 i40evf: allocate ring structs dynamically

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

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.

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(-)
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +1 -1
index 35fc721..3725744 100644
@@ -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
drivers/net/ethernet/intel/i40evf/i40evf.h +2 -2
index bd185ad..a6318c4 100644
@@ -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;
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +4 -4
index ec059b3..2e5c940 100644
@@ -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;
 	}
 }
 
drivers/net/ethernet/intel/i40evf/i40evf_main.c +28 -29

146 lines not on this page · raw message

drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +5 -5
index 24b3af3..9b55576 100644
@@ -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++;
 	}
 
Signature · 1 line
1.9.3
#28 lore raw

PATCH 14/15 i40evf: allocate ring structs dynamically

Quoted 22 lines

-----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 <[email protected]>

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.

Change-ID I31334ff911a6474954232cfe4bc98ccca3c769ff

---
Testing-hints: Ensure the driver loads and passes traffic, and unloads properly.

Quoted 7 lines
 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(-)

Patch code changes correctly applied, driver loads and unloads properly and passes traffic.

#29 lore raw

PATCH 15/15 i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1

In reply to Catherine Sullivan

Bump.

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(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 4e9d6e5..7759703 100644
@@ -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
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
index 67a2b47..0776e67 100644
@@ -34,7 +34,7 @@ char i40evf_driver_name[] = "i40evf";
 static const char i40evf_driver_string[] =
 	"Intel(R) XL710/X710 Virtual Function Network Driver";
 
-#define DRV_VERSION "1.3.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.";
Signature · 1 line
1.9.3
#30 lore raw

PATCH 15/15 i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, 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

Quoted 8 lines

Bump.

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(-)

Patch code changes correctly applied, modinfo shows correct driver version, driver shows correct version on init.