Skip to contentSkip to conversation

i40e/i40evf updates

PATCH New Bimmy Pujari 3 participants 35 messages May 16, 2016 – May 17, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover i40e/i40evf updates

Avinash Dayanand removes unnecessary code which caused supported link mode bug.

Catherine Sullivan adds a call to set the client interface down and fixes RSS
to not be limited by the number of CPUs.

Greg Rose adds code to clean up MSIX irqs before suspend and save PCI state before suspend.

Mitch Williams adds functions to clear default VSI, adds hw struct local variable, writes HENA for VFs, reports RSS hash capability to stack, , fixes buffer overflow problem by checking the address count and bailing out of the loop at the appropriate time, adds code to activate correct MAC address filter and sets default VSI without a reset

Serey Kong fixes missing DA cable check.

Shannon Nelson adds VSI info to macaddr messages.

Bimmy Pujari bumps version from 1.5.16 to 1.6.4.

 drivers/net/ethernet/intel/i40e/i40e_common.c      |  56 +++++++
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 162 ++++++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |   2 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   6 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |   7 +-
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |   8 +
 7 files changed, 175 insertions(+), 70 deletions(-)
Signature · 1 line
2.4.11
#1 lore raw

PATCH 1/15 i40e: add functions to control default VSI

From: Mitch Williams <[email protected]>

Add functions to enable and disable default VSI on a VEB. This allows for configuration of limited promiscuous mode specifically for bridging purposes.

Change-ID I0cc5bd68b31c500fdff4d47e1f15d50d2739faf4
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 56 ++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 +
 2 files changed, 58 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +56 -0
index 422b41d..b87bfc6 100644
@@ -1967,6 +1967,62 @@ aq_add_vsi_exit:
 }
 
 /**
+ * i40e_aq_set_default_vsi
+ * @hw: pointer to the hw struct
+ * @seid: vsi number
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw,
+				    u16 seid,
+				struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
+		(struct i40e_aqc_set_vsi_promiscuous_modes *)
+		&desc.params.raw;
+	i40e_status status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+					  i40e_aqc_opc_set_vsi_promiscuous_modes);
+
+	cmd->promiscuous_flags = cpu_to_le16(I40E_AQC_SET_VSI_DEFAULT);
+	cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_DEFAULT);
+	cmd->seid = cpu_to_le16(seid);
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
+/**
+ * i40e_aq_clear_default_vsi
+ * @hw: pointer to the hw struct
+ * @seid: vsi number
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw,
+				      u16 seid,
+				struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
+		(struct i40e_aqc_set_vsi_promiscuous_modes *)
+		&desc.params.raw;
+	i40e_status status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+					  i40e_aqc_opc_set_vsi_promiscuous_modes);
+
+	cmd->promiscuous_flags = cpu_to_le16(0);
+	cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_DEFAULT);
+	cmd->seid = cpu_to_le16(seid);
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
+/**
  * i40e_aq_set_vsi_unicast_promiscuous
  * @hw: pointer to the hw struct
  * @seid: vsi number
drivers/net/ethernet/intel/i40e/i40e_prototype.h +2 -0
index 80403c6..4660c5a 100644
@@ -98,6 +98,8 @@ i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
 				struct i40e_asq_cmd_details *cmd_details);
+i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw, u16 vsi_id,
+				      struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
 			bool qualified_modules, bool report_init,
 			struct i40e_aq_get_phy_abilities_resp *abilities,
Signature · 1 line
2.4.11
#2 lore raw

PATCH 1/15 i40e: add functions to control default VSI

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 01/15] i40e: add functions to control default VSI

From: Mitch Williams <[email protected]>

Add functions to enable and disable default VSI on a VEB. This allows for configuration of limited promiscuous mode specifically for bridging purposes.

Quoted 7 lines
Change-ID I0cc5bd68b31c500fdff4d47e1f15d50d2739faf4
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 56
++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 +
 2 files changed, 58 insertions(+)
#3 lore raw

PATCH 2/15 i40e: add hw struct local variable

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

This function uses the i40e_hw struct all over the place, so why doesn't it keep a pointer to the struct? Add this pointer as a local variable and use it consistently throughout the function.

Change-ID I10eb688fe40909433fcb8ac7ac891cef67445d72

---
Testing Hints : No functionality change, just code simplification.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 79 +++++++++++++++--------------
 1 file changed, 41 insertions(+), 38 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +41 -38
index d091c76..ad2191c 100644
@@ -1845,6 +1845,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 {
 	struct list_head tmp_del_list, tmp_add_list;
 	struct i40e_mac_filter *f, *ftmp, *fclone;
+	struct i40e_hw *hw = &vsi->back->hw;
 	bool promisc_forced_on = false;
 	bool add_happened = false;
 	int filter_list_len = 0;
@@ -1925,7 +1926,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 	if (!list_empty(&tmp_del_list)) {
 		int del_list_size;
 
-		filter_list_len = pf->hw.aq.asq_buf_size /
+		filter_list_len = hw->aq.asq_buf_size /
 			    sizeof(struct i40e_aqc_remove_macvlan_element_data);
 		del_list_size = filter_list_len *
 			    sizeof(struct i40e_aqc_remove_macvlan_element_data);
@@ -1957,12 +1958,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 
 			/* flush a full buffer */
 			if (num_del == filter_list_len) {
-				aq_ret = i40e_aq_remove_macvlan(&pf->hw,
-								vsi->seid,
-								del_list,
-								num_del,
-								NULL);
-				aq_err = pf->hw.aq.asq_last_status;
+				aq_ret =
+					i40e_aq_remove_macvlan(hw, vsi->seid,
+							       del_list,
+							       num_del, NULL);
+				aq_err = hw->aq.asq_last_status;
 				num_del = 0;
 				memset(del_list, 0, del_list_size);
 
@@ -1970,8 +1970,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 					retval = -EIO;
 					dev_err(&pf->pdev->dev,
 						"ignoring delete macvlan error, err %s, aq_err %s while flushing a full buffer\n",
-						i40e_stat_str(&pf->hw, aq_ret),
-						i40e_aq_str(&pf->hw, aq_err));
+
+						 i40e_stat_str(hw, aq_ret),
+						 i40e_aq_str(hw, aq_err));
 				}
 			}
 			/* Release memory for MAC filter entries which were
@@ -1982,17 +1983,16 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 		}
 
 		if (num_del) {
-			aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,
-							del_list, num_del,
-							NULL);
-			aq_err = pf->hw.aq.asq_last_status;
+			aq_ret = i40e_aq_remove_macvlan(hw, vsi->seid, del_list,
+							num_del, NULL);
+			aq_err = hw->aq.asq_last_status;
 			num_del = 0;
 
 			if (aq_ret && aq_err != I40E_AQ_RC_ENOENT)
 				dev_info(&pf->pdev->dev,
 					 "ignoring delete macvlan error, err %s aq_err %s\n",
-					 i40e_stat_str(&pf->hw, aq_ret),
-					 i40e_aq_str(&pf->hw, aq_err));
+					 i40e_stat_str(hw, aq_ret),
+					 i40e_aq_str(hw, aq_err));
 		}
 
 		kfree(del_list);
@@ -2003,7 +2003,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 		int add_list_size;
 
 		/* do all the adds now */
-		filter_list_len = pf->hw.aq.asq_buf_size /
+		filter_list_len = hw->aq.asq_buf_size /
 			       sizeof(struct i40e_aqc_add_macvlan_element_data),
 		add_list_size = filter_list_len *
 			       sizeof(struct i40e_aqc_add_macvlan_element_data);
@@ -2038,10 +2038,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 
 			/* flush a full buffer */
 			if (num_add == filter_list_len) {
-				aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
+				aq_ret = i40e_aq_add_macvlan(hw, vsi->seid,
 							     add_list, num_add,
 							     NULL);
-				aq_err = pf->hw.aq.asq_last_status;
+				aq_err = hw->aq.asq_last_status;
 				num_add = 0;
 
 				if (aq_ret)
@@ -2056,9 +2056,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 		}
 
 		if (num_add) {
-			aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
+			aq_ret = i40e_aq_add_macvlan(hw, vsi->seid,
 						     add_list, num_add, NULL);
-			aq_err = pf->hw.aq.asq_last_status;
+			aq_err = hw->aq.asq_last_status;
 			num_add = 0;
 		}
 		kfree(add_list);
@@ -2068,9 +2068,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 			retval = i40e_aq_rc_to_posix(aq_ret, aq_err);
 			dev_info(&pf->pdev->dev,
 				 "add filter failed, err %s aq_err %s\n",
-				 i40e_stat_str(&pf->hw, aq_ret),
-				 i40e_aq_str(&pf->hw, aq_err));
-			if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
+				 i40e_stat_str(hw, aq_ret),
+				 i40e_aq_str(hw, aq_err));
+			if ((hw->aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
 			    !test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 				      &vsi->state)) {
 				promisc_forced_on = true;
@@ -2098,12 +2098,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 							       NULL);
 		if (aq_ret) {
 			retval = i40e_aq_rc_to_posix(aq_ret,
-						     pf->hw.aq.asq_last_status);
+						     hw->aq.asq_last_status);
 			dev_info(&pf->pdev->dev,
 				 "set multi promisc failed, err %s aq_err %s\n",
-				 i40e_stat_str(&pf->hw, aq_ret),
-				 i40e_aq_str(&pf->hw,
-					     pf->hw.aq.asq_last_status));
+				 i40e_stat_str(hw, aq_ret),
+				 i40e_aq_str(hw, hw->aq.asq_last_status));
 		}
 	}
 	if ((changed_flags & IFF_PROMISC) || promisc_forced_on) {
@@ -2126,29 +2125,33 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 			}
 		} else {
 			aq_ret = i40e_aq_set_vsi_unicast_promiscuous(
-							  &vsi->back->hw,
+							  hw,
 							  vsi->seid,
 							  cur_promisc, NULL,
 							  true);
 			if (aq_ret) {
 				retval =
 				i40e_aq_rc_to_posix(aq_ret,
-						    pf->hw.aq.asq_last_status);
+						    hw->aq.asq_last_status);
 				dev_info(&pf->pdev->dev,
-					 "set unicast promisc failed, err %d, aq_err %d\n",
-					 aq_ret, pf->hw.aq.asq_last_status);
+					 "set unicast promisc failed, err %s, aq_err %s\n",
+					 i40e_stat_str(hw, aq_ret),
+					 i40e_aq_str(hw,
+						     hw->aq.asq_last_status));
 			}
 			aq_ret = i40e_aq_set_vsi_multicast_promiscuous(
-							  &vsi->back->hw,
+							  hw,
 							  vsi->seid,
 							  cur_promisc, NULL);
 			if (aq_ret) {
 				retval =
 				i40e_aq_rc_to_posix(aq_ret,
-						    pf->hw.aq.asq_last_status);
+						    hw->aq.asq_last_status);
 				dev_info(&pf->pdev->dev,
-					 "set multicast promisc failed, err %d, aq_err %d\n",
-					 aq_ret, pf->hw.aq.asq_last_status);
+					 "set multicast promisc failed, err %s, aq_err %s\n",
+					 i40e_stat_str(hw, aq_ret),
+					 i40e_aq_str(hw,
+						     hw->aq.asq_last_status));
 			}
 		}
 		aq_ret = i40e_aq_set_vsi_broadcast(&vsi->back->hw,
@@ -2159,9 +2162,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 						     pf->hw.aq.asq_last_status);
 			dev_info(&pf->pdev->dev,
 				 "set brdcast promisc failed, err %s, aq_err %s\n",
-				 i40e_stat_str(&pf->hw, aq_ret),
-				 i40e_aq_str(&pf->hw,
-					     pf->hw.aq.asq_last_status));
+					 i40e_stat_str(hw, aq_ret),
+					 i40e_aq_str(hw,
+						     hw->aq.asq_last_status));
 		}
 	}
 out:
Signature · 1 line
2.4.11
#4 lore raw

PATCH 2/15 i40e: add hw struct local variable

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 02/15] i40e: add hw struct local variable

From: Mitch Williams <[email protected]>

This function uses the i40e_hw struct all over the place, so why doesn't it keep a pointer to the struct? Add this pointer as a local variable and use it consistently throughout the function.

Quoted 8 lines
Change-ID I10eb688fe40909433fcb8ac7ac891cef67445d72

---
Testing Hints : No functionality change, just code simplification.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 79 +++++++++++++++--------
------
 1 file changed, 41 insertions(+), 38 deletions(-)
#5 lore raw

PATCH 3/15 i40e: write HENA for VFs

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

Now that VF RSS is configured by the PF driver, it needs to set the RSS Hash Enable registers by default. Without this, no packets will be hashed and they'll all end up on queue 0.

Change-ID I38e425f40ddb81e3b19a951cfbb939fa5b1123f1

---
Testing Hints : Send packets to the VF and observe which receive queues are in use using ethtool -S.

 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -0
index 31014a7..fe2eba6 100644
@@ -665,6 +665,8 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)
 		goto error_alloc_vsi_res;
 	}
 	if (type == I40E_VSI_SRIOV) {
+		u64 hena = i40e_pf_get_default_rss_hena(pf);
+
 		vf->lan_vsi_idx = vsi->idx;
 		vf->lan_vsi_id = vsi->id;
 		/* If the port VLAN has been configured and then the
@@ -687,6 +689,10 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)
 					vf->default_lan_addr.addr, vf->vf_id);
 		}
 		spin_unlock_bh(&vsi->mac_filter_list_lock);
+		i40e_write_rx_ctl(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id),
+				  (u32)hena);
+		i40e_write_rx_ctl(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id),
+				  (u32)(hena >> 32));
 	}
 
 	/* program mac filter */
Signature · 1 line
2.4.11
#6 lore raw

PATCH 3/15 i40e: write HENA for VFs

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 03/15] i40e: write HENA for VFs

From: Mitch Williams <[email protected]>

Now that VF RSS is configured by the PF driver, it needs to set the RSS Hash Enable registers by default. Without this, no packets will be hashed and they'll all end up on queue 0.

Quoted 8 lines
Change-ID I38e425f40ddb81e3b19a951cfbb939fa5b1123f1

---
Testing Hints : Send packets to the VF and observe which receive queues are in use using ethtool -S.

 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 ++++++
 1 file changed, 6 insertions(+)

Receive traffic properly spreads out among queues on VF

#7 lore raw

PATCH 4/15 i40e: Add a call to set the client interface down

In reply to Bimmy Pujari

From: Catherine Sullivan <[email protected]>

We were failing to set the client interface down when we put the vsi down. Add this call so that the client doesn't get an open called with no close.

Also remove an un-needed delay. The vf should not be affected at all by i40e_down.

Change-ID I1135dffef534bf84e6fed57cf51bcf590e6cfaf7

---
Testing Hints: See HSD
HSD-number: 7662119

 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -7
index ad2191c..3439e9f 100644
@@ -5186,12 +5186,6 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi)
 		usleep_range(1000, 2000);
 	i40e_down(vsi);
 
-	/* Give a VF some time to respond to the reset.  The
-	 * two second wait is based upon the watchdog cycle in
-	 * the VF driver.
-	 */
-	if (vsi->type == I40E_VSI_SRIOV)
-		msleep(2000);
 	i40e_up(vsi);
 	clear_bit(__I40E_CONFIG_BUSY, &pf->state);
 }
@@ -5234,6 +5228,9 @@ void i40e_down(struct i40e_vsi *vsi)
 		i40e_clean_tx_ring(vsi->tx_rings[i]);
 		i40e_clean_rx_ring(vsi->rx_rings[i]);
 	}
+
+	i40e_notify_client_of_netdev_close(vsi, false);
+
 }
 
 /**
@@ -5943,7 +5940,6 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)
 		if (I40E_DEBUG_FD & pf->hw.debug_mask)
 			dev_info(&pf->pdev->dev, "FD Filter table flushed and FD-SB replayed.\n");
 	}
-
 }
 
 /**
Signature · 1 line
2.4.11
#8 lore raw

PATCH 4/15 i40e: Add a call to set the client interface down

Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 04/15] i40e: Add a call to set the client interface down

From: Catherine Sullivan <[email protected]>

We were failing to set the client interface down when we put the vsi down. Add this call so that the client doesn't get an open called with no close.

Also remove an un-needed delay. The vf should not be affected at all by i40e_down.

Quoted 8 lines
Change-ID I1135dffef534bf84e6fed57cf51bcf590e6cfaf7

---
Testing Hints: See HSD
HSD-number: 7662119

 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Verified fixed per HSD

#9 lore raw

PATCH 5/15 i40evf: report RSS hash capability to stack

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

Set the NETIF_F_RXHASH flag to tell the stack that the device hashes packets.

Change-ID I0394366ad8e8bf90bb2815d757a402c39628ccb2

---
Testing Hints : Use ethtool -k to see that the device support receive hashing.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -0
index 642bb45..ae67be4 100644
@@ -2233,6 +2233,7 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
 				   NETIF_F_GSO_IPIP		|
 				   NETIF_F_GSO_SIT		|
 				   NETIF_F_GSO_UDP_TUNNEL	|
+				   NETIF_F_RXHASH	        |
 				   NETIF_F_GSO_UDP_TUNNEL_CSUM	|
 				   NETIF_F_GSO_PARTIAL		|
 				   NETIF_F_SCTP_CRC		|
Signature · 1 line
2.4.11
#10 lore raw

PATCH 5/15 i40evf: report RSS hash capability to stack

Quoted 5 lines · Bimmy Pujari

From: Mitch Williams <[email protected]>

Set the NETIF_F_RXHASH flag to tell the stack that the device hashes packets.

Quoted 8 lines
Change-ID I0394366ad8e8bf90bb2815d757a402c39628ccb2

---
Testing Hints : Use ethtool -k to see that the device support receive hashing.

?drivers/net/ethernet/intel/i40evf/i40evf_main.c | 1 + ?1 file changed, 1 insertion(+)

Dropping this patch because NETIF_F_RXHASH is already set in this function,
so this patch adds a duplicate flag.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160517/e9a6d062/attachment.asc>

#11 lore raw

PATCH 5/15 i40evf: report RSS hash capability to stack

In reply to Bimmy Pujari
Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 05/15] i40evf: report RSS hash capability to stack

From: Mitch Williams <[email protected]>

Set the NETIF_F_RXHASH flag to tell the stack that the device hashes packets.

Quoted 7 lines
Change-ID I0394366ad8e8bf90bb2815d757a402c39628ccb2

---
Testing Hints : Use ethtool -k to see that the device support receive hashing.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 1 +
 1 file changed, 1 insertion(+)

ethtool -k shows device supports receive hashing

#12 lore raw

PATCH 6/15 i40evf: don't overflow buffer

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

If the user adds an obscene amount of MAC addresses, the driver will run into the situation where it has too many address requests to fit into a single PF message. The driver checks for this case, and calculates the maximum number of messages that it can send. Then it completely ignores this count and overflows the buffer.

Fix this by checking the address count and bailing out of the loop at the appropriate time.

Change-ID If8dcbb04602c75941dc0cd8309065e1de9ca791c

---
Testing Hints : Add a thousand filters as quickly as possible.

 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +8 -0
index f134456..d76c221 100644
@@ -434,6 +434,8 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)
 			ether_addr_copy(veal->list[i].addr, f->macaddr);
 			i++;
 			f->add = false;
+			if (i == count)
+				break;
 		}
 	}
 	if (!more)
@@ -497,6 +499,8 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)
 			i++;
 			list_del(&f->list);
 			kfree(f);
+			if (i == count)
+				break;
 		}
 	}
 	if (!more)
@@ -560,6 +564,8 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)
 			vvfl->vlan_id[i] = f->vlan;
 			i++;
 			f->add = false;
+			if (i == count)
+				break;
 		}
 	}
 	if (!more)
@@ -623,6 +629,8 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)
 			i++;
 			list_del(&f->list);
 			kfree(f);
+			if (i == count)
+				break;
 		}
 	}
 	if (!more)
Signature · 1 line
2.4.11
#13 lore raw

PATCH 6/15 i40evf: don't overflow buffer

Quoted 19 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 06/15] i40evf: don't overflow buffer

From: Mitch Williams <[email protected]>

If the user adds an obscene amount of MAC addresses, the driver will run into the situation where it has too many address requests to fit into a single PF message. The driver checks for this case, and calculates the maximum number of messages that it can send. Then it completely ignores this count and overflows the buffer.

Fix this by checking the address count and bailing out of the loop at the appropriate time.

Quoted 7 lines
Change-ID If8dcbb04602c75941dc0cd8309065e1de9ca791c

---
Testing Hints : Add a thousand filters as quickly as possible.

 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Successfully added 1000 MACs without error or overflow

#14 lore raw

PATCH 7/15 i40e: Clean up MSIX irqs before suspend

In reply to Bimmy Pujari

From: Greg Rose <[email protected]>

The i40e_suspend() function calls another function that preps the device for the power save and resume by freeing all the tx/rx resources and interrupts but that function does not free the "other" causes interrupt vector and irq. It also fails to call synchronize_irq() before freeing the irq vectors. This sometimes may result in some AER errors on those systems with that PCIe error reporting feature enabled.

Call synchronize_irq() before freeing irq vectors and explicitly free the other causes interrupt resources and shut down that MSIX interrupt.

Change-ID Ib88e4536756518a352446da0232189716618ad81
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -0
index 3439e9f..d71b6bc 100644
@@ -3955,6 +3955,7 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
 			/* clear the affinity_mask in the IRQ descriptor */
 			irq_set_affinity_hint(pf->msix_entries[vector].vector,
 					      NULL);
+			synchronize_irq(pf->msix_entries[vector].vector);
 			free_irq(pf->msix_entries[vector].vector,
 				 vsi->q_vectors[i]);
 
@@ -11535,6 +11536,8 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
 	wr32(hw, I40E_PFPM_APM, (pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));
 	wr32(hw, I40E_PFPM_WUFC, (pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
 
+	i40e_stop_misc_vector(pf);
+
 	pci_wake_from_d3(pdev, pf->wol_en);
 	pci_set_power_state(pdev, PCI_D3hot);
 
Signature · 1 line
2.4.11
#15 lore raw

PATCH 7/15 i40e: Clean up MSIX irqs before suspend

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 07/15] i40e: Clean up MSIX irqs before suspend

From: Greg Rose <[email protected]>

The i40e_suspend() function calls another function that preps the device for the power save and resume by freeing all the tx/rx resources and interrupts but that function does not free the "other" causes interrupt vector and irq. It also fails to call synchronize_irq() before freeing the irq vectors. This sometimes may result in some AER errors on those systems with that PCIe error reporting feature enabled.

Quoted 8 lines

Call synchronize_irq() before freeing irq vectors and explicitly free the other causes interrupt resources and shut down that MSIX interrupt.

Change-ID Ib88e4536756518a352446da0232189716618ad81
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++
 1 file changed, 3 insertions(+)

Device suspends and resumes as expected

#16 lore raw

PATCH 8/15 i40e: Save PCI state before suspend

In reply to Bimmy Pujari

From: Greg Rose <[email protected]>

The i40e_suspend() function was failing to save PCI state and this would result in a kernel stack trace from a WARN_ONCE in the pci_legacy_suspend() function.

Add a call to pci_save_state() to fix that problem.

Change-ID I4736e62bb660966bd208cc8af617a14cb07fc4bd
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -1
index d71b6bc..ae4d089 100644
@@ -11525,6 +11525,7 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
 	struct i40e_hw *hw = &pf->hw;
+	int retval = 0;
 
 	set_bit(__I40E_SUSPENDED, &pf->state);
 	set_bit(__I40E_DOWN, &pf->state);
@@ -11538,10 +11539,14 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
 
 	i40e_stop_misc_vector(pf);
 
+	retval = pci_save_state(pdev);
+	if (retval)
+		return retval;
+
 	pci_wake_from_d3(pdev, pf->wol_en);
 	pci_set_power_state(pdev, PCI_D3hot);
 
-	return 0;
+	return retval;
 }
 
 /**
Signature · 1 line
2.4.11
#17 lore raw

PATCH 8/15 i40e: Save PCI state before suspend

ACK

Quoted 60 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 08/15] i40e: Save PCI state before suspend

From: Greg Rose <[email protected]>

The i40e_suspend() function was failing to save PCI state and this would result in a kernel stack trace from a WARN_ONCE in the pci_legacy_suspend() function.

Add a call to pci_save_state() to fix that problem.

Change-ID I4736e62bb660966bd208cc8af617a14cb07fc4bd
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
index d71b6bc..ae4d089 100644
@@ -11525,6 +11525,7 @@ static int i40e_suspend(struct pci_dev *pdev,
 pm_message_t state)
 {
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
 	struct i40e_hw *hw = &pf->hw;
+	int retval = 0;
 
 	set_bit(__I40E_SUSPENDED, &pf->state);
drivers/net/ethernet/intel/i40e/i40e_main.c +5 -1
 	set_bit(__I40E_DOWN, &pf->state);
@@ -11538,10 +11539,14 @@ static int i40e_suspend(struct pci_dev *pdev,
 pm_message_t state)
 
 	i40e_stop_misc_vector(pf);
 
+	retval = pci_save_state(pdev);
+	if (retval)
+		return retval;
+
 	pci_wake_from_d3(pdev, pf->wol_en);
 	pci_set_power_state(pdev, PCI_D3hot);
 
-	return 0;
+	return retval;
 }
 

/**
--
2.4.11

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#18 lore raw

PATCH 8/15 i40e: Save PCI state before suspend

In reply to Bimmy Pujari
Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 08/15] i40e: Save PCI state before suspend

From: Greg Rose <[email protected]>

The i40e_suspend() function was failing to save PCI state and this would result in a kernel stack trace from a WARN_ONCE in the pci_legacy_suspend() function.

Quoted 7 lines

Add a call to pci_save_state() to fix that problem.

Change-ID I4736e62bb660966bd208cc8af617a14cb07fc4bd
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Device suspends and resumes as expected

#19 lore raw

PATCH 9/15 i40e: fix missing DA cable check

In reply to Bimmy Pujari

From: Serey Kong <[email protected]>

When a Direct Attach (DA) cable is used, if the i40e_set_settings function is called it would return an error. Add the DA type so the function won't fail.

Change-ID I2b802f27a5d91cfefa72fd1f852acb4d74647a8e
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -0
index dce812e..0e80b35 100644
@@ -663,6 +663,7 @@ static int i40e_set_settings(struct net_device *netdev,
 	if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
 	    hw->phy.media_type != I40E_MEDIA_TYPE_FIBER &&
 	    hw->phy.media_type != I40E_MEDIA_TYPE_BACKPLANE &&
+	    hw->phy.media_type != I40E_MEDIA_TYPE_DA &&
 	    hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
 		return -EOPNOTSUPP;
 
Signature · 1 line
2.4.11
#20 lore raw

PATCH 9/15 i40e: fix missing DA cable check

Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Kong, Serey <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S37 09/15] i40e: fix missing DA cable check

From: Serey Kong <[email protected]>

Quoted 8 lines

When a Direct Attach (DA) cable is used, if the i40e_set_settings function is called it would return an error. Add the DA type so the function won't fail.

Change-ID I2b802f27a5d91cfefa72fd1f852acb4d74647a8e
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 +
 1 file changed, 1 insertion(+)

DA cable correctly identified

#21 lore raw

PATCH 10/15 i40e: Removing unnecessary code which caused supported link mode bug

In reply to Bimmy Pujari

From: Avinash Dayanand <[email protected]>

Removing this code which wasn't allowing 100BaseT to show up in the supported link modes for 10GBaseT PHYs.

Change-ID Iada2eafa7ef6b4bac9a2a1380ff533ae5de51e1d

---
Testing Hints: Use 'ethtool ethx' check if 100BaseT is listed as one of the supported link modes.

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -2
index 0e80b35..0a96c5a 100644
@@ -313,8 +313,7 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
 		*advertising |= ADVERTISED_Autoneg |
 			       ADVERTISED_40000baseCR4_Full;
 	}
-	if ((phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) &&
-	    !(phy_types & I40E_CAP_PHY_TYPE_1000BASE_T)) {
+	if (phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) {
 		*supported |= SUPPORTED_Autoneg |
 			     SUPPORTED_100baseT_Full;
 		*advertising |= ADVERTISED_Autoneg |
Signature · 1 line
2.4.11
#22 lore raw

PATCH 10/15 i40e: Removing unnecessary code which caused supported link mode bug

ACK, looks good..

-----Original Message-----
From: Pujari, Bimmy
Sent: Monday, May 16, 2016 10:27 AM
To: [email protected]
Cc: Dayanand, Avinash <[email protected]>
Subject: [next PATCH S37 10/15] i40e: Removing unnecessary code which caused supported link mode bug

From: Avinash Dayanand <[email protected]>

Removing this code which wasn't allowing 100BaseT to show up in the supported link modes for 10GBaseT PHYs.

Change-ID Iada2eafa7ef6b4bac9a2a1380ff533ae5de51e1d

---
Testing Hints: Use 'ethtool ethx' check if 100BaseT is listed as one of the supported link modes.

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -2
index 0e80b35..0a96c5a 100644
@@ -313,8 +313,7 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
 		*advertising |= ADVERTISED_Autoneg |
 			       ADVERTISED_40000baseCR4_Full;
 	}
-	if ((phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) &&
-	    !(phy_types & I40E_CAP_PHY_TYPE_1000BASE_T)) {
+	if (phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) {
 		*supported |= SUPPORTED_Autoneg |
 			     SUPPORTED_100baseT_Full;
 		*advertising |= ADVERTISED_Autoneg |

--
2.4.11

#23 lore raw

PATCH 10/15 i40e: Removing unnecessary code which caused supported link mode bug

Quoted 1 line · Avinash

ACK, looks good..?

Do not top-post! ?Patchwork thought you were submitting a new patch, instead of responding to a patch that was already in the queue.

Quoted 13 lines

-----Original Message-----
From: Pujari, Bimmy?
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Dayanand, Avinash <[email protected]>
Subject: [next PATCH S37 10/15] i40e: Removing unnecessary code which caused supported link mode bug

From: Avinash Dayanand <[email protected]>

Removing this code which wasn't allowing 100BaseT to show up in the supported link modes for 10GBaseT PHYs.

Quoted 8 lines
Change-ID Iada2eafa7ef6b4bac9a2a1380ff533ae5de51e1d

---
Testing Hints: Use 'ethtool ethx' check if 100BaseT is listed as one of the supported link modes.

?drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +-- ?1 file changed, 1 insertion(+), 2 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160516/f72150d5/attachment.asc>

#24 lore raw

PATCH 10/15 i40e: Removing unnecessary code which caused supported link mode bug

In reply to Bimmy Pujari
Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 10/15] i40e: Removing unnecessary code which caused supported link mode bug

From: Avinash Dayanand <[email protected]>

Removing this code which wasn't allowing 100BaseT to show up in the supported link modes for 10GBaseT PHYs.

Quoted 8 lines
Change-ID Iada2eafa7ef6b4bac9a2a1380ff533ae5de51e1d

---
Testing Hints: Use 'ethtool ethx' check if 100BaseT is listed as one of the supported link modes.

 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

100BaseT shown as supported link mode on 10GBaseT PHY

#25 lore raw

PATCH 11/15 i40e: Fix RSS to not be limited by the number of CPUs

In reply to Bimmy Pujari

From: Catherine Sullivan <[email protected]>

Limiting qcount to pf->num_lan_msix, effectively limits the RSS queues to only use the number of CPUs, and ignore all other queues. We don't want to do this. If the user has changed the RSS settings to use more queues then CPUS, we want to trust they know what they are doing and let them. More importantly, if we tell them that is what we did, we want to actually do it and allow traffic into all of the queues we have allocated. This does not change the default setting to initially allocate only the number of CPUS of queue pairs.

Change-ID Ie941a96e806e4bcd016addb4e17affb46770ada5

---
Testing Hints: Make sure that RSS can hit all queues up to the maximum for XL710,X710,X722, including a NPAR nic.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -8
index ae4d089..b749b46 100644
@@ -1584,14 +1584,8 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
 	vsi->tc_config.numtc = numtc;
 	vsi->tc_config.enabled_tc = enabled_tc ? enabled_tc : 1;
 	/* Number of queues per enabled TC */
-	/* In MFP case we can have a much lower count of MSIx
-	 * vectors available and so we need to lower the used
-	 * q count.
-	 */
-	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
-		qcount = min_t(int, vsi->alloc_queue_pairs, pf->num_lan_msix);
-	else
-		qcount = vsi->alloc_queue_pairs;
+	qcount = vsi->alloc_queue_pairs;
+
 	num_tc_qps = qcount / numtc;
 	num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
 
Signature · 1 line
2.4.11
#26 lore raw

PATCH 11/15 i40e: Fix RSS to not be limited by the number of CPUs

Quoted 19 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 11/15] i40e: Fix RSS to not be limited by the number of CPUs

From: Catherine Sullivan <[email protected]>

Limiting qcount to pf->num_lan_msix, effectively limits the RSS queues to only use the number of CPUs, and ignore all other queues. We don't want to do this. If the user has changed the RSS settings to use more queues then CPUS, we want to trust they know what they are doing and let them. More importantly, if we tell them that is what we did, we want to actually do it and allow traffic into all of the queues we have allocated. This does not change the default setting to initially allocate only the number of CPUS of queue pairs.

Quoted 8 lines
Change-ID Ie941a96e806e4bcd016addb4e17affb46770ada5

---
Testing Hints: Make sure that RSS can hit all queues up to the maximum for XL710,X710,X722, including a NPAR nic.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

RSS not limited by number of CPUs

#27 lore raw

PATCH 12/15 i40evf: always activate correct MAC address filter

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

Always add MAC address at the tail of the MAC filter list. Since the device's "real" MAC address is added first, it will always be at the beginning of the list. This prevents an issue where the "real" MAC filter might not get added if too many other filters are added before bringing the interface up.

Change-ID I34a8aeebeb0cb87a44b24118adc4176c7b943c1c

---
Testing Hints : Add a lot of MAC filters before bringing the interface up. Ensure it still works on the base MAC address.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
index ae67be4..41581ad 100644
@@ -825,7 +825,7 @@ i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter,
 
 		ether_addr_copy(f->macaddr, macaddr);
 
-		list_add(&f->list, &adapter->mac_filter_list);
+		list_add_tail(&f->list, &adapter->mac_filter_list);
 		f->add = true;
 		adapter->aq_required |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;
 	}
Signature · 1 line
2.4.11
#28 lore raw

PATCH 12/15 i40evf: always activate correct MAC address filter

Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 12/15] i40evf: always activate correct MAC address filter

From: Mitch Williams <[email protected]>

Always add MAC address at the tail of the MAC filter list. Since the device's "real" MAC address is added first, it will always be at the beginning of the list. This prevents an issue where the "real" MAC filter might not get added if too many other filters are added before bringing the interface up.

Quoted 8 lines
Change-ID I34a8aeebeb0cb87a44b24118adc4176c7b943c1c

---
Testing Hints : Add a lot of MAC filters before bringing the interface up. Ensure it still works on the base MAC address.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Real mac filter remains at top of filter list regardless of number of MACs added before bringing interface up, tools report hardware MAC

#29 lore raw

PATCH 13/15 i40e: set default VSI without a reset

In reply to Bimmy Pujari

From: Mitch Williams <[email protected]>

Remove the need for a reset when the device enters limited promiscuous mode. This was causing heartburn for people who were using VFs and bridging, since this would require all of the VFs to undergo a reset each time the PF changed its promiscuity.

Change-ID I0a83495c5e4d68112bbc7a7a076d20fa8dd3b61c

---
Testing Hints : Make sure default (limited) promiscuous mode works correctly with bridging, and that no resets happen when entering and leaving promiscuous mode.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +22 -4
index b749b46..16197f9 100644
@@ -2115,7 +2115,25 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 			 */
 			if (pf->cur_promisc != cur_promisc) {
 				pf->cur_promisc = cur_promisc;
-				set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
+				if (cur_promisc)
+					aq_ret =
+					      i40e_aq_set_default_vsi(hw,
+								      vsi->seid,
+								      NULL);
+				else
+					aq_ret =
+					    i40e_aq_clear_default_vsi(hw,
+								      vsi->seid,
+								      NULL);
+				if (aq_ret) {
+					retval = i40e_aq_rc_to_posix(aq_ret,
+							hw->aq.asq_last_status);
+					dev_info(&pf->pdev->dev,
+						 "Set default VSI failed, err %s, aq_err %s\n",
+						 i40e_stat_str(hw, aq_ret),
+						 i40e_aq_str(hw,
+						     hw->aq.asq_last_status));
+				}
 			}
 		} else {
 			aq_ret = i40e_aq_set_vsi_unicast_promiscuous(
@@ -10127,14 +10145,14 @@ void i40e_veb_release(struct i40e_veb *veb)
 static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
 {
 	struct i40e_pf *pf = veb->pf;
-	bool is_default = veb->pf->cur_promisc;
 	bool enable_stats = !!(pf->flags & I40E_FLAG_VEB_STATS_ENABLED);
 	int ret;
 
-	/* get a VEB from the hardware */
 	ret = i40e_aq_add_veb(&pf->hw, veb->uplink_seid, vsi->seid,
-			      veb->enabled_tc, is_default,
+			      veb->enabled_tc, false,
 			      &veb->seid, enable_stats, NULL);
+
+	/* get a VEB from the hardware */
 	if (ret) {
 		dev_info(&pf->pdev->dev,
 			 "couldn't add VEB, err %s aq_err %s\n",
Signature · 1 line
2.4.11
#30 lore raw

PATCH 13/15 i40e: set default VSI without a reset

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 13/15] i40e: set default VSI without a reset

From: Mitch Williams <[email protected]>

Remove the need for a reset when the device enters limited promiscuous mode. This was causing heartburn for people who were using VFs and bridging, since this would require all of the VFs to undergo a reset each time the PF changed its promiscuity.

Change-ID I0a83495c5e4d68112bbc7a7a076d20fa8dd3b61c
Quoted 8 lines

---
Testing Hints : Make sure default (limited) promiscuous mode works correctly with bridging, and that no resets happen when entering and leaving promiscuous mode.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 26
++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

Bridges and entering/leaving promiscuous mode works correctly and does not trigger a reset

#31 lore raw

PATCH 14/15 i40e: add VSI info to macaddr messages

In reply to Bimmy Pujari

From: Shannon Nelson <[email protected]>

Since the macaddr add and delete happens asynchronously, error messages don't easily get associated to the actual request. Here we add a bit of information to the error messages to help determine the source of the error.

Change-ID Id2d6df5287141c3579677d72d8bd21122823d79f
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +22 -9
index 16197f9..5b9a64f 100644
@@ -1842,6 +1842,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 	struct i40e_hw *hw = &vsi->back->hw;
 	bool promisc_forced_on = false;
 	bool add_happened = false;
+	char vsi_name[16] = "PF";
 	int filter_list_len = 0;
 	u32 changed_flags = 0;
 	i40e_status aq_ret = 0;
@@ -1869,6 +1870,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 	INIT_LIST_HEAD(&tmp_del_list);
 	INIT_LIST_HEAD(&tmp_add_list);
 
+	if (vsi->type == I40E_VSI_SRIOV)
+		snprintf(vsi_name, sizeof(vsi_name) - 1, "VF %d", vsi->vf_id);
+	else if (vsi->type != I40E_VSI_MAIN)
+		snprintf(vsi_name, sizeof(vsi_name) - 1, "vsi %d", vsi->seid);
+
 	if (vsi->flags & I40E_VSI_FLAG_FILTER_CHANGED) {
 		vsi->flags &= ~I40E_VSI_FLAG_FILTER_CHANGED;
 
@@ -1963,8 +1969,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 				if (aq_ret && aq_err != I40E_AQ_RC_ENOENT) {
 					retval = -EIO;
 					dev_err(&pf->pdev->dev,
-						"ignoring delete macvlan error, err %s, aq_err %s while flushing a full buffer\n",
-
+						 "ignoring delete macvlan error on %s, err %s, aq_err %s while flushing a full buffer\n",
+						 vsi_name,
 						 i40e_stat_str(hw, aq_ret),
 						 i40e_aq_str(hw, aq_err));
 				}
@@ -1984,7 +1990,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 
 			if (aq_ret && aq_err != I40E_AQ_RC_ENOENT)
 				dev_info(&pf->pdev->dev,
-					 "ignoring delete macvlan error, err %s aq_err %s\n",
+					 "ignoring delete macvlan error on %s, err %s aq_err %s\n",
+					 vsi_name,
 					 i40e_stat_str(hw, aq_ret),
 					 i40e_aq_str(hw, aq_err));
 		}
@@ -2061,7 +2068,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 		if (add_happened && aq_ret && aq_err != I40E_AQ_RC_EINVAL) {
 			retval = i40e_aq_rc_to_posix(aq_ret, aq_err);
 			dev_info(&pf->pdev->dev,
-				 "add filter failed, err %s aq_err %s\n",
+				 "add filter failed on %s, err %s aq_err %s\n",
+				 vsi_name,
 				 i40e_stat_str(hw, aq_ret),
 				 i40e_aq_str(hw, aq_err));
 			if ((hw->aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
@@ -2070,7 +2078,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 				promisc_forced_on = true;
 				set_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 					&vsi->state);
-				dev_info(&pf->pdev->dev, "promiscuous mode forced on\n");
+				dev_info(&pf->pdev->dev, "promiscuous mode forced on %s\n",
+					 vsi_name);
 			}
 		}
 	}
@@ -2094,7 +2103,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 			retval = i40e_aq_rc_to_posix(aq_ret,
 						     hw->aq.asq_last_status);
 			dev_info(&pf->pdev->dev,
-				 "set multi promisc failed, err %s aq_err %s\n",
+				 "set multi promisc failed on %s, err %s aq_err %s\n",
+				 vsi_name,
 				 i40e_stat_str(hw, aq_ret),
 				 i40e_aq_str(hw, hw->aq.asq_last_status));
 		}
@@ -2129,7 +2139,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 					retval = i40e_aq_rc_to_posix(aq_ret,
 							hw->aq.asq_last_status);
 					dev_info(&pf->pdev->dev,
-						 "Set default VSI failed, err %s, aq_err %s\n",
+						 "Set default VSI failed on %s, err %s, aq_err %s\n",
+						 vsi_name,
 						 i40e_stat_str(hw, aq_ret),
 						 i40e_aq_str(hw,
 						     hw->aq.asq_last_status));
@@ -2146,7 +2157,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 				i40e_aq_rc_to_posix(aq_ret,
 						    hw->aq.asq_last_status);
 				dev_info(&pf->pdev->dev,
-					 "set unicast promisc failed, err %s, aq_err %s\n",
+					 "set unicast promisc failed on %s, err %s, aq_err %s\n",
+					 vsi_name,
 					 i40e_stat_str(hw, aq_ret),
 					 i40e_aq_str(hw,
 						     hw->aq.asq_last_status));
@@ -2160,7 +2172,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
 				i40e_aq_rc_to_posix(aq_ret,
 						    hw->aq.asq_last_status);
 				dev_info(&pf->pdev->dev,
-					 "set multicast promisc failed, err %s, aq_err %s\n",
+					 "set multicast promisc failed on %s, err %s, aq_err %s\n",
+					 vsi_name,
 					 i40e_stat_str(hw, aq_ret),
 					 i40e_aq_str(hw,
 						     hw->aq.asq_last_status));
Signature · 1 line
2.4.11
#32 lore raw

PATCH 14/15 i40e: add VSI info to macaddr messages

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 14/15] i40e: add VSI info to macaddr messages

From: Shannon Nelson <[email protected]>

Since the macaddr add and delete happens asynchronously, error messages don't easily get associated to the actual request. Here we add a bit of information to the error messages to help determine the source of the error.

Quoted 6 lines
Change-ID Id2d6df5287141c3579677d72d8bd21122823d79f
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 31
++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

Tested messages show VSI information

#33 lore raw

PATCH 15/15 i40e/i40evf: Bump version from 1.5.16 to 1.6.4

In reply to Bimmy Pujari
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
index 5b9a64f..a4caa11 100644
@@ -45,8 +45,8 @@ static const char i40e_driver_string[] =
 #define DRV_KERN "-k"
 
 #define DRV_VERSION_MAJOR 1
-#define DRV_VERSION_MINOR 5
-#define DRV_VERSION_BUILD 16
+#define DRV_VERSION_MINOR 6
+#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 +2 -2
index 41581ad..d952893 100644
@@ -37,8 +37,8 @@ static const char i40evf_driver_string[] =
 #define DRV_KERN "-k"
 
 #define DRV_VERSION_MAJOR 1
-#define DRV_VERSION_MINOR 5
-#define DRV_VERSION_BUILD 10
+#define DRV_VERSION_MINOR 6
+#define DRV_VERSION_BUILD 4
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD) \
Signature · 1 line
2.4.11
#34 lore raw

PATCH 15/15 i40e/i40evf: Bump version from 1.5.16 to 1.6.4

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bimmy Pujari
Sent: Monday, May 16, 2016 10:27 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S37 15/15] i40e/i40evf: Bump version from 1.5.16 to 1.6.4

Quoted 5 lines
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Driver reports correct version