All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27
@ 2016-06-29  4:40 Jeff Kirsher
  2016-06-29  4:40 ` [net-next 01/16] i40e: add functions to control default VSI Jeff Kirsher
                   ` (16 more replies)
  0 siblings, 17 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains updates to i40e and i40evf only.

Mitch provides several changes, first adds functions to enable and disable
VSI on a VEB, which allows for configuration of limited promiscuous mode
specifically for bridging purposes.  Sets the RSS Hash Enable registers by
default now that VF RSS is configured by the PF driver.  Fixed a issue
where we could overflow the buffer, by checking the address count and bail
out of the loop at the appropriate time.  Removed the need for a reset
when the device enters limited promiscuous mode, since this was causing
heartburn for people who were using VFs and bridging.

Catherine adds a call to set the client interface down when we put the VSI
down.  Fixed an issue where RSS queues was being limited to the number
of CPUs, so if a user wants to use more queues than CPUs, we want to
trust they know what they are doing and let them.

Greg cleans up the driver suspend routine to ensure we are calling
synchronize_irq() before freeing IRQ vectors and explicitly free the other
causes interrupt resources and shut down the MSIX interrupt.

Serey fixes i40e_set_settings() to not fail when a Direct Attach (DA)
cable is used.

Avinash fixes a supported link bug by removing code which was not allowing
100BaseT to show up in the supported link modes for 10GBaseT PHYs.

Shannon adds a bit of information to the error messages to help determine
the source of error by adding VSI info to macaddr messages.

Tushar Dave fixes error received when turning off TSO on some systems,
which was caused by enabling FD_SB without checking availability of
MSIx vectors, so add the check.

Neerav fixes a possible panic when LLDP/DCBX change happens and the
driver tried to notify the client(s) for each of the PF VSIs, which would
panic when it reached a VSI that did not have any netdev associated with
it.

The following are changes since commit de2fbe7ae3637533ebf711b91b04988633bf38ee:
  Merge branch 'sfp-infra'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 40GbE

Avinash Dayanand (1):
  i40e: Removing unnecessary code which caused supported link mode bug

Bimmy Pujari (1):
  i40e/i40evf: Bump version from 1.5.16 to 1.6.4

Catherine Sullivan (2):
  i40e: Add a call to set the client interface down
  i40e: Fix RSS to not be limited by the number of CPUs

Greg Rose (2):
  i40e: Clean up MSIX IRQs before suspend
  i40e: Save PCI state before suspend

Mitch Williams (6):
  i40e: add functions to control default VSI
  i40e: add hw struct local variable
  i40e: write HENA for VFs
  i40evf: don't overflow buffer
  i40evf: always activate correct MAC address filter
  i40e: set default VSI without a reset

Neerav Parikh (1):
  i40e: Don't notify client(s) for DCB changes on all VSIs

Serey Kong (1):
  i40e: fix missing DA cable check

Shannon Nelson (1):
  i40e: add VSI info to macaddr messages

Tushar Dave (1):
  i40e: Fix errors resulted while turning off TSO

 drivers/net/ethernet/intel/i40e/i40e.h             |   1 +
 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        | 173 +++++++++++++--------
 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    |   6 +-
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |   8 +
 8 files changed, 183 insertions(+), 73 deletions(-)

-- 
2.5.5

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

* [net-next 01/16] i40e: add functions to control default VSI
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 02/16] i40e: add hw struct local variable Jeff Kirsher
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 56 ++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 +
 2 files changed, 58 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 422b41d..e447dc4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -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
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 80403c6..4660c5a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -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,
-- 
2.5.5

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

* [net-next 02/16] i40e: add hw struct local variable
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
  2016-06-29  4:40 ` [net-next 01/16] i40e: add functions to control default VSI Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29 13:00   ` David Laight
  2016-06-29  4:40 ` [net-next 03/16] i40e: write HENA for VFs Jeff Kirsher
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 79 +++++++++++++++--------------
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 734cba6..9a26ecc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1840,6 +1840,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;
@@ -1920,7 +1921,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);
@@ -1952,12 +1953,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);
 
@@ -1965,8 +1965,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
@@ -1977,17 +1978,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);
@@ -1998,7 +1998,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);
@@ -2033,10 +2033,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)
@@ -2051,9 +2051,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);
@@ -2063,9 +2063,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;
@@ -2093,12 +2093,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) {
@@ -2121,29 +2120,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,
@@ -2154,9 +2157,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:
-- 
2.5.5

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

* [net-next 03/16] i40e: write HENA for VFs
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
  2016-06-29  4:40 ` [net-next 01/16] i40e: add functions to control default VSI Jeff Kirsher
  2016-06-29  4:40 ` [net-next 02/16] i40e: add hw struct local variable Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 04/16] i40e: Add a call to set the client interface down Jeff Kirsher
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 1fcafcf..6fcbf76 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -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 */
-- 
2.5.5

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

* [net-next 04/16] i40e: Add a call to set the client interface down
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 03/16] i40e: write HENA for VFs Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 05/16] i40evf: don't overflow buffer Jeff Kirsher
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem
  Cc: Catherine Sullivan, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

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
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 9a26ecc..a2b4012 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5181,12 +5181,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);
 }
@@ -5229,6 +5223,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);
+
 }
 
 /**
@@ -5931,7 +5928,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");
 	}
-
 }
 
 /**
-- 
2.5.5

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

* [net-next 05/16] i40evf: don't overflow buffer
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 04/16] i40e: Add a call to set the client interface down Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 06/16] i40e: Clean up MSIX IRQs before suspend Jeff Kirsher
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index f134456..d76c221 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -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)
-- 
2.5.5

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

* [net-next 06/16] i40e: Clean up MSIX IRQs before suspend
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (4 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 05/16] i40evf: don't overflow buffer Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 07/16] i40e: Save PCI state " Jeff Kirsher
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Greg Rose, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

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
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a2b4012..e071c22 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3950,6 +3950,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]);
 
@@ -11451,6 +11452,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);
 
-- 
2.5.5

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

* [net-next 07/16] i40e: Save PCI state before suspend
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (5 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 06/16] i40e: Clean up MSIX IRQs before suspend Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29 14:49   ` Greg
  2016-06-29  4:40 ` [net-next 08/16] i40e: fix missing DA cable check Jeff Kirsher
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Greg Rose, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

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
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index e071c22..52d9d28 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11441,6 +11441,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);
@@ -11454,10 +11455,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.5.5

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

* [net-next 08/16] i40e: fix missing DA cable check
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (6 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 07/16] i40e: Save PCI state " Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 09/16] i40e: Removing unnecessary code which caused supported link mode bug Jeff Kirsher
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Serey Kong, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Serey Kong <serey.kong@intel.com>

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
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 5e8d84f..8381dab 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -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;
 
-- 
2.5.5

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

* [net-next 09/16] i40e: Removing unnecessary code which caused supported link mode bug
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (7 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 08/16] i40e: fix missing DA cable check Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 10/16] i40e: Fix RSS to not be limited by the number of CPUs Jeff Kirsher
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Avinash Dayanand, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Avinash Dayanand <avinash.dayanand@intel.com>

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

Change-ID: Iada2eafa7ef6b4bac9a2a1380ff533ae5de51e1d
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 8381dab..4962e85 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -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.5.5

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

* [net-next 10/16] i40e: Fix RSS to not be limited by the number of CPUs
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (8 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 09/16] i40e: Removing unnecessary code which caused supported link mode bug Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 11/16] i40evf: always activate correct MAC address filter Jeff Kirsher
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem
  Cc: Catherine Sullivan, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

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
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 52d9d28..a32be7c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1579,14 +1579,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));
 
-- 
2.5.5

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

* [net-next 11/16] i40evf: always activate correct MAC address filter
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (9 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 10/16] i40e: Fix RSS to not be limited by the number of CPUs Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 12/16] i40e: set default VSI without a reset Jeff Kirsher
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 16c5529..da9221b 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -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;
 	}
-- 
2.5.5

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

* [net-next 12/16] i40e: set default VSI without a reset
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (10 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 11/16] i40evf: always activate correct MAC address filter Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:40 ` [net-next 13/16] i40e: add VSI info to macaddr messages Jeff Kirsher
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

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

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
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a32be7c..d6a5106 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2110,7 +2110,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(
@@ -10047,14 +10065,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",
-- 
2.5.5

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

* [net-next 13/16] i40e: add VSI info to macaddr messages
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (11 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 12/16] i40e: set default VSI without a reset Jeff Kirsher
@ 2016-06-29  4:40 ` Jeff Kirsher
  2016-06-29  4:41 ` [net-next 14/16] i40e/i40evf: Bump version from 1.5.16 to 1.6.4 Jeff Kirsher
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:40 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

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
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d6a5106..880602f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1837,6 +1837,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;
@@ -1864,6 +1865,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;
 
@@ -1958,8 +1964,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));
 				}
@@ -1979,7 +1985,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));
 		}
@@ -2056,7 +2063,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) &&
@@ -2065,7 +2073,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);
 			}
 		}
 	}
@@ -2089,7 +2098,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));
 		}
@@ -2124,7 +2134,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));
@@ -2141,7 +2152,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));
@@ -2155,7 +2167,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));
-- 
2.5.5

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

* [net-next 14/16] i40e/i40evf: Bump version from 1.5.16 to 1.6.4
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (12 preceding siblings ...)
  2016-06-29  4:40 ` [net-next 13/16] i40e: add VSI info to macaddr messages Jeff Kirsher
@ 2016-06-29  4:41 ` Jeff Kirsher
  2016-06-29  4:41 ` [net-next 15/16] i40e: Fix errors resulted while turning off TSO Jeff Kirsher
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:41 UTC (permalink / raw)
  To: davem; +Cc: Bimmy Pujari, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Bimmy Pujari <bimmy.pujari@intel.com>

Signed-off-by: Bimmy Pujari <bimmy.pujari@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 880602f..3e394bf 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -40,8 +40,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
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index da9221b..eac057b 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -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) \
-- 
2.5.5

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

* [net-next 15/16] i40e: Fix errors resulted while turning off TSO
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (13 preceding siblings ...)
  2016-06-29  4:41 ` [net-next 14/16] i40e/i40evf: Bump version from 1.5.16 to 1.6.4 Jeff Kirsher
@ 2016-06-29  4:41 ` Jeff Kirsher
  2016-06-29  4:41 ` [net-next 16/16] i40e: Don't notify client(s) for DCB changes on all VSIs Jeff Kirsher
  2016-06-29 12:23 ` [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 David Miller
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:41 UTC (permalink / raw)
  To: davem; +Cc: Tushar Dave, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Tushar Dave <tushar.n.dave@oracle.com>

On systems with 128 CPUs, turning off TSO results in errors,

i40e 0000:03:00.0: failed to get tracking for 1 vectors for VSI 400, err=-12
i40e 0000:03:00.0: Couldn't create FDir VSI
i40e 0000:03:00.0: i40e_ptp_init: PTP not supported on eth0
i40e 0000:03:00.0: couldn't add VEB, err I40E_ERR_ADMIN_QUEUE_ERROR aq_err I40E_AQ_RC_ENOENT
i40e 0000:03:00.0: rebuild of switch failed: -1, will try to set up simple PF connection
i40e 0000:03:00.0 eth0: adding 00:10:e0:8a:24:b6 vid=0

Enabling FD_SB without checking availability of MSI-X vector is the
root cause. This change adds necessary check.

Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      | 1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 9c44739..e83fc8a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -283,6 +283,7 @@ struct i40e_pf {
 #endif /* I40E_FCOE */
 	u16 num_lan_qps;           /* num lan queues this PF has set up */
 	u16 num_lan_msix;          /* num queue vectors for the base PF vsi */
+	u16 num_fdsb_msix;         /* num queue vectors for sideband Fdir */
 	u16 num_iwarp_msix;        /* num of iwarp vectors for this PF */
 	int iwarp_base_vector;
 	int queues_left;           /* queues left unclaimed */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3e394bf..a313194 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7185,7 +7185,7 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)
 		vsi->alloc_queue_pairs = 1;
 		vsi->num_desc = ALIGN(I40E_FDIR_RING_COUNT,
 				      I40E_REQ_DESCRIPTOR_MULTIPLE);
-		vsi->num_q_vectors = 1;
+		vsi->num_q_vectors = pf->num_fdsb_msix;
 		break;
 
 	case I40E_VSI_VMDQ2:
@@ -7569,9 +7569,11 @@ static int i40e_init_msix(struct i40e_pf *pf)
 	/* reserve one vector for sideband flow director */
 	if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
 		if (vectors_left) {
+			pf->num_fdsb_msix = 1;
 			v_budget++;
 			vectors_left--;
 		} else {
+			pf->num_fdsb_msix = 0;
 			pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
 		}
 	}
@@ -8590,7 +8592,9 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)
 		/* Enable filters and mark for reset */
 		if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
 			need_reset = true;
-		pf->flags |= I40E_FLAG_FD_SB_ENABLED;
+		/* enable FD_SB only if there is MSI-X vector */
+		if (pf->num_fdsb_msix > 0)
+			pf->flags |= I40E_FLAG_FD_SB_ENABLED;
 	} else {
 		/* turn off filters, mark for reset and clear SW filter list */
 		if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
-- 
2.5.5

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

* [net-next 16/16] i40e: Don't notify client(s) for DCB changes on all VSIs
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (14 preceding siblings ...)
  2016-06-29  4:41 ` [net-next 15/16] i40e: Fix errors resulted while turning off TSO Jeff Kirsher
@ 2016-06-29  4:41 ` Jeff Kirsher
  2016-06-29 12:23 ` [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 David Miller
  16 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2016-06-29  4:41 UTC (permalink / raw)
  To: davem
  Cc: Neerav Parikh, netdev, nhorman, sassmann, jogreene,
	Usha Ketineni, Jeff Kirsher

From: Neerav Parikh <neerav.parikh@intel.com>

When LLDP/DCBX change happens the i40e driver code flow tried to
notify the client(s) for each of the PF VSIs. This resulted into
kernel panic on the first VSI that didn't have any netdev
associated to it.

The DCB change notification to the client(s) should be done only
once for the PF/LAN VSI where the client(s) instances have been
added to. Also, move the notification call after the PF driver has
made changes related to the updated DCB configuration.

Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
Tested-by: Ronald J Bynoe <ronald.j.bynoe@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a313194..2b11405 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4982,7 +4982,6 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf)
 			if (pf->vsi[v]->netdev)
 				i40e_dcbnl_set_all(pf->vsi[v]);
 		}
-		i40e_notify_client_of_l2_param_changes(pf->vsi[v]);
 	}
 }
 
@@ -5730,6 +5729,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
 		i40e_service_event_schedule(pf);
 	} else {
 		i40e_pf_unquiesce_all_vsi(pf);
+		/* Notify the client for the DCB changes */
+		i40e_notify_client_of_l2_param_changes(pf->vsi[pf->lan_vsi]);
 	}
 
 exit:
-- 
2.5.5

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

* Re: [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27
  2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
                   ` (15 preceding siblings ...)
  2016-06-29  4:41 ` [net-next 16/16] i40e: Don't notify client(s) for DCB changes on all VSIs Jeff Kirsher
@ 2016-06-29 12:23 ` David Miller
  16 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2016-06-29 12:23 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 28 Jun 2016 21:40:46 -0700

> This series contains updates to i40e and i40evf only.

Pulled, thanks Jeff.

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

* RE: [net-next 02/16] i40e: add hw struct local variable
  2016-06-29  4:40 ` [net-next 02/16] i40e: add hw struct local variable Jeff Kirsher
@ 2016-06-29 13:00   ` David Laight
  0 siblings, 0 replies; 20+ messages in thread
From: David Laight @ 2016-06-29 13:00 UTC (permalink / raw)
  To: 'Jeff Kirsher', davem
  Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher
> Sent: 29 June 2016 05:41
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> 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
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 79 +++++++++++++++--------------
>  1 file changed, 41 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 734cba6..9a26ecc 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -1840,6 +1840,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;
> @@ -1920,7 +1921,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 /
...

I suspect you've just made the compiler use separate registers for
pf and hw.
This could easily cause additional register spills to/from stack.

	David

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

* Re: [net-next 07/16] i40e: Save PCI state before suspend
  2016-06-29  4:40 ` [net-next 07/16] i40e: Save PCI state " Jeff Kirsher
@ 2016-06-29 14:49   ` Greg
  0 siblings, 0 replies; 20+ messages in thread
From: Greg @ 2016-06-29 14:49 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Greg Rose, netdev, nhorman, sassmann, jogreene

On Tue, 2016-06-28 at 21:40 -0700, Jeff Kirsher wrote:
> From: Greg Rose <gregory.v.rose@intel.com>
> 
> 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
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Acked-by: Greg Rose <grose@lightfleet.com>

:)

> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index e071c22..52d9d28 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -11441,6 +11441,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);
> @@ -11454,10 +11455,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;
>  }
>  
>  /**

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

end of thread, other threads:[~2016-06-29 14:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29  4:40 [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 Jeff Kirsher
2016-06-29  4:40 ` [net-next 01/16] i40e: add functions to control default VSI Jeff Kirsher
2016-06-29  4:40 ` [net-next 02/16] i40e: add hw struct local variable Jeff Kirsher
2016-06-29 13:00   ` David Laight
2016-06-29  4:40 ` [net-next 03/16] i40e: write HENA for VFs Jeff Kirsher
2016-06-29  4:40 ` [net-next 04/16] i40e: Add a call to set the client interface down Jeff Kirsher
2016-06-29  4:40 ` [net-next 05/16] i40evf: don't overflow buffer Jeff Kirsher
2016-06-29  4:40 ` [net-next 06/16] i40e: Clean up MSIX IRQs before suspend Jeff Kirsher
2016-06-29  4:40 ` [net-next 07/16] i40e: Save PCI state " Jeff Kirsher
2016-06-29 14:49   ` Greg
2016-06-29  4:40 ` [net-next 08/16] i40e: fix missing DA cable check Jeff Kirsher
2016-06-29  4:40 ` [net-next 09/16] i40e: Removing unnecessary code which caused supported link mode bug Jeff Kirsher
2016-06-29  4:40 ` [net-next 10/16] i40e: Fix RSS to not be limited by the number of CPUs Jeff Kirsher
2016-06-29  4:40 ` [net-next 11/16] i40evf: always activate correct MAC address filter Jeff Kirsher
2016-06-29  4:40 ` [net-next 12/16] i40e: set default VSI without a reset Jeff Kirsher
2016-06-29  4:40 ` [net-next 13/16] i40e: add VSI info to macaddr messages Jeff Kirsher
2016-06-29  4:41 ` [net-next 14/16] i40e/i40evf: Bump version from 1.5.16 to 1.6.4 Jeff Kirsher
2016-06-29  4:41 ` [net-next 15/16] i40e: Fix errors resulted while turning off TSO Jeff Kirsher
2016-06-29  4:41 ` [net-next 16/16] i40e: Don't notify client(s) for DCB changes on all VSIs Jeff Kirsher
2016-06-29 12:23 ` [net-next 00/16][pull request] 40GbE Intel Wired LAN Driver Updates 2016-06-27 David Miller

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