All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected
@ 2017-07-14 13:27 Alice Michael
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level Alice Michael
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Mariusz Stachura <mariusz.stachura@intel.com>

An eratta with GLQF_PCNT causes it to not wrap as expected. This
can cause an error in flow director statistics. This patch resets
affected counters just after reading.

Testing Hints (required if no HSD): DCR 2187

Signed-off-by: Mariusz Stachura <mariusz.stachura@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 35 +++++++++++++++++++----------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 647a7a6..43ed431 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -600,6 +600,20 @@ static void i40e_stat_update32(struct i40e_hw *hw, u32 reg,
 }
 
 /**
+ * i40e_stat_update_and_clear32 - read and clear hw reg, update a 32 bit stat
+ * @hw: ptr to the hardware info
+ * @reg: the hw reg to read and clear
+ * @stat: ptr to the stat
+ **/
+static void i40e_stat_update_and_clear32(struct i40e_hw *hw, u32 reg, u64 *stat)
+{
+	u32 new_data = rd32(hw, reg);
+
+	wr32(hw, reg, 1); /* must write a nonzero value to clear register */
+	*stat += new_data;
+}
+
+/**
  * i40e_update_eth_stats - Update VSI-specific ethernet statistics counters.
  * @vsi: the VSI to be updated
  **/
@@ -1040,18 +1054,15 @@ static void i40e_update_pf_stats(struct i40e_pf *pf)
 			   &osd->rx_jabber, &nsd->rx_jabber);
 
 	/* FDIR stats */
-	i40e_stat_update32(hw,
-			   I40E_GLQF_PCNT(I40E_FD_ATR_STAT_IDX(pf->hw.pf_id)),
-			   pf->stat_offsets_loaded,
-			   &osd->fd_atr_match, &nsd->fd_atr_match);
-	i40e_stat_update32(hw,
-			   I40E_GLQF_PCNT(I40E_FD_SB_STAT_IDX(pf->hw.pf_id)),
-			   pf->stat_offsets_loaded,
-			   &osd->fd_sb_match, &nsd->fd_sb_match);
-	i40e_stat_update32(hw,
-		      I40E_GLQF_PCNT(I40E_FD_ATR_TUNNEL_STAT_IDX(pf->hw.pf_id)),
-		      pf->stat_offsets_loaded,
-		      &osd->fd_atr_tunnel_match, &nsd->fd_atr_tunnel_match);
+	i40e_stat_update_and_clear32(hw,
+			I40E_GLQF_PCNT(I40E_FD_ATR_STAT_IDX(hw->pf_id)),
+			&nsd->fd_atr_match);
+	i40e_stat_update_and_clear32(hw,
+			I40E_GLQF_PCNT(I40E_FD_SB_STAT_IDX(hw->pf_id)),
+			&nsd->fd_sb_match);
+	i40e_stat_update_and_clear32(hw,
+			I40E_GLQF_PCNT(I40E_FD_ATR_TUNNEL_STAT_IDX(hw->pf_id)),
+			&nsd->fd_atr_tunnel_match);
 
 	val = rd32(hw, I40E_PRTPM_EEE_STAT);
 	nsd->tx_lpi_status =
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 18:00   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup Alice Michael
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

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

We see this message regularly on VF reset or unload (which invokes a
reset). It's essentially meaningless unless it's happening constantly.
To prevent consternation, lower the log level to debug so it's not seen
under normal circumstance.

Testing Hints (required if no HSD): Load and unload VF driver, observe
dmesg in VM.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 6c403bf..d22813e 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -52,7 +52,7 @@ static int i40evf_send_pf_msg(struct i40evf_adapter *adapter,
 
 	err = i40e_aq_send_msg_to_pf(hw, op, 0, msg, len, NULL);
 	if (err)
-		dev_err(&adapter->pdev->dev, "Unable to send opcode %d to PF, err %s, aq_err %s\n",
+		dev_dbg(&adapter->pdev->dev, "Unable to send opcode %d to PF, err %s, aq_err %s\n",
 			op, i40evf_stat_str(hw, err),
 			i40evf_aq_str(hw, hw->aq.asq_last_status));
 	return err;
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 18:03   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks Alice Michael
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

We currently (mis)use the __I40E_RECOVERY_PENDING bit to determine when
we should actually request a new IRQ in i40e_setup_misc_vector().

This led to a design mistake where we open-coded the re-setup of the
miscellaneous vector in i40e_resume() instead of using the function
provided. If we did not open-code this and instead tried to use the
i40e_setup_misc_vector() function, it would lead to never reallocating
the IRQ.

This would lead to a second i40e_suspend() call failing to free the
vector due to a NULL pointer dereference.

A future patch is going to re-work how the i40e_suspend() and
i40e_resume() flows work to clear all IRQ vectors, which would require
us to use i40e_setup_misc_vector() directly. Since during this time the
__I40E_RECOVERY_PENDING bit is set, we'll never re-allocate the vector.

Rather than leaving the open-coded setup in i40e_resume() lets just fix
the problem properly in i40e_setup_misc_vector().

Introduce a new state bit which indicates when the IRQ has been
assigned, which will be set when i40e_setup_misc_vector is first called.
This ultimately resolves the issue of re-requesting the vector, without
overloading the __I40E_RECOVERY_PENDING state. This ensures that the
suspend/resume cycle can use the setup function instead of open-coding
the re-request during resume.

Additionally, since the only callers of i40e_stop_misc_vector also want
to free it, move this code directly into the function to avoid
duplication. Due to the new functionality, rename it to
i40e_free_misc_vector().

This lets us drop the extra calls to free and re-enable the vector
during i40e_suspend() and i40e_resume(). We don't need to call
i40e_setup_misc_Vector() in i40e_resume() because it gets called by the
i40e_rebuild() call.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c | 39 +++++++++++------------------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 5f75e67..2f1f65e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -136,6 +136,7 @@ enum i40e_state_t {
 	__I40E_MDD_EVENT_PENDING,
 	__I40E_VFLR_EVENT_PENDING,
 	__I40E_RESET_RECOVERY_PENDING,
+	__I40E_MISC_IRQ_REQUESTED,
 	__I40E_RESET_INTR_RECEIVED,
 	__I40E_REINIT_REQUESTED,
 	__I40E_PF_RESET_REQUESTED,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 43ed431..c41815f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3605,14 +3605,20 @@ static int i40e_vsi_enable_irq(struct i40e_vsi *vsi)
 }
 
 /**
- * i40e_stop_misc_vector - Stop the vector that handles non-queue events
+ * i40e_free_misc_vector - Free the vector that handles non-queue events
  * @pf: board private structure
  **/
-static void i40e_stop_misc_vector(struct i40e_pf *pf)
+static void i40e_free_misc_vector(struct i40e_pf *pf)
 {
 	/* Disable ICR 0 */
 	wr32(&pf->hw, I40E_PFINT_ICR0_ENA, 0);
 	i40e_flush(&pf->hw);
+
+	if (pf->flags & I40E_FLAG_MSIX_ENABLED && pf->msix_entries) {
+		synchronize_irq(pf->msix_entries[0].vector);
+		free_irq(pf->msix_entries[0].vector, pf);
+		clear_bit(__I40E_MISC_IRQ_REQUESTED, pf->state);
+	}
 }
 
 /**
@@ -4467,11 +4473,7 @@ static void i40e_clear_interrupt_scheme(struct i40e_pf *pf)
 {
 	int i;
 
-	i40e_stop_misc_vector(pf);
-	if (pf->flags & I40E_FLAG_MSIX_ENABLED && pf->msix_entries) {
-		synchronize_irq(pf->msix_entries[0].vector);
-		free_irq(pf->msix_entries[0].vector, pf);
-	}
+	i40e_free_misc_vector(pf);
 
 	i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector,
 		      I40E_IWARP_IRQ_PILE_ID);
@@ -8351,13 +8353,12 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)
 	struct i40e_hw *hw = &pf->hw;
 	int err = 0;
 
-	/* Only request the irq if this is the first time through, and
-	 * not when we're rebuilding after a Reset
-	 */
-	if (!test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state)) {
+	/* Only request the IRQ once, the first time through. */
+	if (!test_and_set_bit(__I40E_MISC_IRQ_REQUESTED, pf->state)) {
 		err = request_irq(pf->msix_entries[0].vector,
 				  i40e_intr, 0, pf->int_name, pf);
 		if (err) {
+			clear_bit(__I40E_MISC_IRQ_REQUESTED, pf->state);
 			dev_info(&pf->pdev->dev,
 				 "request_irq for %s failed: %d\n",
 				 pf->int_name, err);
@@ -12055,11 +12056,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);
-	if (pf->msix_entries) {
-		synchronize_irq(pf->msix_entries[0].vector);
-		free_irq(pf->msix_entries[0].vector, pf);
-	}
+	i40e_free_misc_vector(pf);
+
 	retval = pci_save_state(pdev);
 	if (retval)
 		return retval;
@@ -12099,15 +12097,6 @@ static int i40e_resume(struct pci_dev *pdev)
 	/* handling the reset will rebuild the device state */
 	if (test_and_clear_bit(__I40E_SUSPENDED, pf->state)) {
 		clear_bit(__I40E_DOWN, pf->state);
-		if (pf->msix_entries) {
-			err = request_irq(pf->msix_entries[0].vector,
-					  i40e_intr, 0, pf->int_name, pf);
-			if (err) {
-				dev_err(&pf->pdev->dev,
-					"request_irq for %s failed: %d\n",
-					pf->int_name, err);
-			}
-		}
 		i40e_reset_and_rebuild(pf, false, false);
 	}
 
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level Alice Michael
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 18:50   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming Alice Michael
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

Stop using the old legacy PM support, since we now have stable support
for the newer generic PM callbacks.

This has several advantages. First, we no longer have to manage our
own pci_save_state() and power changes, as it's preferred to have the
PCI stack do this. Second, these routines get called for both hibernate
and suspend to ram, so we can have the driver properly handle all the
suspend/resume flows that it needs to.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 54 +++++++++--------------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c41815f..b47cc14 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -12036,14 +12036,14 @@ static void i40e_shutdown(struct pci_dev *pdev)
 
 #ifdef CONFIG_PM
 /**
- * i40e_suspend - PCI callback for moving to D3
- * @pdev: PCI device information struct
+ * i40e_suspend - PM callback for moving to D3
+ * @dev: generic device information structure
  **/
-static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
+static int i40e_suspend(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	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);
@@ -12058,41 +12058,17 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
 
 	i40e_free_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 retval;
+	return 0;
 }
 
 /**
- * i40e_resume - PCI callback for waking up from D3
- * @pdev: PCI device information struct
+ * i40e_resume - PM callback for waking up from D3
+ * @dev: generic device information structure
  **/
-static int i40e_resume(struct pci_dev *pdev)
+static int i40e_resume(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
-	u32 err;
-
-	pci_set_power_state(pdev, PCI_D0);
-	pci_restore_state(pdev);
-	/* pci_restore_state() clears dev->state_saves, so
-	 * call pci_save_state() again to restore it.
-	 */
-	pci_save_state(pdev);
-
-	err = pci_enable_device_mem(pdev);
-	if (err) {
-		dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n");
-		return err;
-	}
-	pci_set_master(pdev);
-
-	/* no wakeup events while running */
-	pci_wake_from_d3(pdev, false);
 
 	/* handling the reset will rebuild the device state */
 	if (test_and_clear_bit(__I40E_SUSPENDED, pf->state)) {
@@ -12103,22 +12079,26 @@ static int i40e_resume(struct pci_dev *pdev)
 	return 0;
 }
 
-#endif
+#endif /* CONFIG_PM */
+
 static const struct pci_error_handlers i40e_err_handler = {
 	.error_detected = i40e_pci_error_detected,
 	.slot_reset = i40e_pci_error_slot_reset,
 	.resume = i40e_pci_error_resume,
 };
 
+static SIMPLE_DEV_PM_OPS(i40e_pm_ops, i40e_suspend, i40e_resume);
+
 static struct pci_driver i40e_driver = {
 	.name     = i40e_driver_name,
 	.id_table = i40e_pci_tbl,
 	.probe    = i40e_probe,
 	.remove   = i40e_remove,
 #ifdef CONFIG_PM
-	.suspend  = i40e_suspend,
-	.resume   = i40e_resume,
-#endif
+	.driver   = {
+		.pm = &i40e_pm_ops,
+	},
+#endif /* CONFIG_PM */
 	.shutdown = i40e_shutdown,
 	.err_handler = &i40e_err_handler,
 	.sriov_configure = i40e_pci_sriov_configure,
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (2 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 18:51   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended Alice Michael
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

When handling suspend and resume callbacks we want to make sure that (a)
we don't suspend again if we're already suspended and (b) we don't
resume again if we're already resuming. Lets make sure we test_and_set
the __I40E_SUSPENDED bit in i40e_suspend which ensures that a suspend
call when already suspended will exit early. Additionally, if
__I40E_SUSPENDED is not set when we begin resuming, exit early as well.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b47cc14..11c9565 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -12045,7 +12045,10 @@ static int i40e_suspend(struct device *dev)
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
 	struct i40e_hw *hw = &pf->hw;
 
-	set_bit(__I40E_SUSPENDED, pf->state);
+	/* If we're already suspended, then there is nothing to do */
+	if (test_and_set_bit(__I40E_SUSPENDED, pf->state))
+		return 0;
+
 	set_bit(__I40E_DOWN, pf->state);
 
 	if (pf->wol_en && (pf->hw_features & I40E_HW_WOL_MC_MAGIC_PKT_WAKE))
@@ -12070,11 +12073,15 @@ static int i40e_resume(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
 
-	/* handling the reset will rebuild the device state */
-	if (test_and_clear_bit(__I40E_SUSPENDED, pf->state)) {
-		clear_bit(__I40E_DOWN, pf->state);
-		i40e_reset_and_rebuild(pf, false, false);
-	}
+	/* If we're not suspended, then there is nothing to do */
+	if (!test_bit(__I40E_SUSPENDED, pf->state))
+		return 0;
+
+	clear_bit(__I40E_DOWN, pf->state);
+	i40e_reset_and_rebuild(pf, false, false);
+
+	/* Clear suspended state last after everything is recovered */
+	clear_bit(__I40E_SUSPENDED, pf->state);
 
 	return 0;
 }
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (3 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 20:45   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended Alice Michael
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

Although the service task does check the suspended status before
running, it might already be part way through running when we go to
suspend. Lets ensure that the service task is stopped and will not be
restarted again until we finish resuming. This ensures that service task
code does not cause strange interactions with the suspend/resume
handlers.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 11c9565..0d2e652 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -12051,6 +12051,10 @@ static int i40e_suspend(struct device *dev)
 
 	set_bit(__I40E_DOWN, pf->state);
 
+	/* Ensure service task will not be running */
+	del_timer_sync(&pf->service_timer);
+	cancel_work_sync(&pf->service_task);
+
 	if (pf->wol_en && (pf->hw_features & I40E_HW_WOL_MC_MAGIC_PKT_WAKE))
 		i40e_enable_mc_magic_wake(pf);
 
@@ -12083,6 +12087,10 @@ static int i40e_resume(struct device *dev)
 	/* Clear suspended state last after everything is recovered */
 	clear_bit(__I40E_SUSPENDED, pf->state);
 
+	/* Restart the service task */
+	mod_timer(&pf->service_timer,
+		  round_jiffies(jiffies + pf->service_timer_period));
+
 	return 0;
 }
 
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (4 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 20:47   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping Alice Michael
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

On some platforms with a large number of CPUs, we will allocate many IRQ
vectors. When hibernating, the system will attempt to migrate all of the
vectors back to CPU0 when shutting down all the other CPUs. It is
possible that we have so many vectors that it cannot re-assign them to
CPU0. This is even more likely if we have many devices installed in one
platform.

The end result is failure to hibernate, as it is not possible to
shutdown the CPUs. We can avoid this by disabling MSI-X and clearing our
interrupt scheme when the device is suspended. A more ideal solution
would be some method for the stack to properly handle this for all
drivers, rather than on a case-by-case basis for each driver to fix
itself.

However, until this more ideal solution exists, we can do our part and
shutdown our IRQs during suspend, which should allow systems with
a large number of CPUs to safely suspend or hibernate.

It may be worth investigating if we should shut down even further when
we suspend as it may make the path cleaner, but this was the minimum fix
for the hibernation issue mentioned here.

Testing-hints:
  This affects systems with a large number of CPUs, and with multiple
  devices enabled. Without this change, those platforms are unable to
  hibernate at all.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 68 ++++++++++++++++++++++++-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |  2 +-
 2 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 0d2e652..1ad014d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8340,6 +8340,57 @@ static int i40e_init_interrupt_scheme(struct i40e_pf *pf)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+/**
+ * i40e_restore_interrupt_scheme - Restore the interrupt scheme
+ * @pf: private board data structure
+ *
+ * Restore the interrupt scheme that was cleared when we suspended the
+ * device. This should be called during resume to re-allocate the q_vectors
+ * and reacquire IRQs.
+ */
+static int i40e_restore_interrupt_scheme(struct i40e_pf *pf)
+{
+	int err, i;
+
+	/* We cleared the MSI and MSI-X flags when disabling the old interrupt
+	 * scheme. We need to re-enabled them here in order to attempt to
+	 * re-acquire the MSI or MSI-X vectors
+	 */
+	pf->flags |= (I40E_FLAG_MSIX_ENABLED | I40E_FLAG_MSI_ENABLED);
+
+	err = i40e_init_interrupt_scheme(pf);
+	if (err)
+		return err;
+
+	/* Now that we've re-acquired IRQs, we need to remap the vectors and
+	 * rings together again.
+	 */
+	for (i = 0; i < pf->num_alloc_vsi; i++) {
+		if (pf->vsi[i]) {
+			err = i40e_vsi_alloc_q_vectors(pf->vsi[i]);
+			if (err)
+				goto err_unwind;
+			i40e_vsi_map_rings_to_vectors(pf->vsi[i]);
+		}
+	}
+
+	err = i40e_setup_misc_vector(pf);
+	if (err)
+		goto err_unwind;
+
+	return 0;
+
+err_unwind:
+	while (i--) {
+		if (pf->vsi[i])
+			i40e_vsi_free_q_vectors(pf->vsi[i]);
+	}
+
+	return err;
+}
+#endif /* CONFIG_PM */
+
 /**
  * i40e_setup_misc_vector - Setup the misc vector to handle non queue events
  * @pf: board private structure
@@ -12063,7 +12114,12 @@ static int i40e_suspend(struct device *dev)
 	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_free_misc_vector(pf);
+	/* Clear the interrupt scheme and release our IRQs so that the system
+	 * can safely hibernate even when there are a large number of CPUs.
+	 * Otherwise hibernation might fail when mapping all the vectors back
+	 * to CPU0.
+	 */
+	i40e_clear_interrupt_scheme(pf);
 
 	return 0;
 }
@@ -12076,11 +12132,21 @@ static int i40e_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
+	int err;
 
 	/* If we're not suspended, then there is nothing to do */
 	if (!test_bit(__I40E_SUSPENDED, pf->state))
 		return 0;
 
+	/* We cleared the interrupt scheme when we suspended, so we need to
+	 * restore it now to resume device functionality.
+	 */
+	err = i40e_restore_interrupt_scheme(pf);
+	if (err) {
+		dev_err(&pdev->dev, "Cannot restore interrupt scheme: %d\n",
+			err);
+	}
+
 	clear_bit(__I40E_DOWN, pf->state);
 	i40e_reset_and_rebuild(pf, false, false);
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 29953c9..d8e17c2 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -46,7 +46,7 @@ static const char i40evf_driver_string[] =
 
 #define DRV_VERSION_MAJOR 3
 #define DRV_VERSION_MINOR 0
-#define DRV_VERSION_BUILD 0
+#define DRV_VERSION_BUILD 1
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD) \
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (5 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 20:47   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues Alice Michael
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Alan Brady <alan.brady@intel.com>

The current implementation for mapping queues to vectors is broken
because it attempts to map each tx and rx ring to its own vector,
however we use combined queues so we should actually be mapping the
tx/rx rings together on one vector.

Also in the current implementation, in the case where we have more
queues than vectors, we attempt to group the queues together into
'chunks' and map each 'chunk' of queues to a vector.  Chunking them
together would be more ideal if, and only if, we only had RSS because of
the way the hashing algorithm works but in the case of a future patch
that enables VF ADq, round robin assignment is better and still works
with RSS.

This patch resolves both those issues and simplifies the code needed to
accomplish this.  Instead of treating the case where we have more queues
than vectors as special, if we notice our vector index is greater than
vectors, reset the vector index to zero and continue mapping.  This
should ensure that in both cases, whether we have enough vectors for
each queue or not, the queues get appropriately mapped.

Testing-hints:
    Make sure traffic continues to be received and features like RSS
    continue to work as expected.

Signed-off-by: Alan Brady <alan.brady@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 48 ++++++-------------------
 1 file changed, 10 insertions(+), 38 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d8e17c2..551fba6 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -432,52 +432,24 @@ i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)
  **/
 static int i40evf_map_rings_to_vectors(struct i40evf_adapter *adapter)
 {
+	int rings_remaining = adapter->num_active_queues;
+	int ridx = 0, vidx = 0;
 	int q_vectors;
-	int v_start = 0;
-	int rxr_idx = 0, txr_idx = 0;
-	int rxr_remaining = adapter->num_active_queues;
-	int txr_remaining = adapter->num_active_queues;
-	int i, j;
-	int rqpv, tqpv;
 	int err = 0;
 
 	q_vectors = adapter->num_msix_vectors - NONQ_VECS;
 
-	/* The ideal configuration...
-	 * We have enough vectors to map one per queue.
-	 */
-	if (q_vectors >= (rxr_remaining * 2)) {
-		for (; rxr_idx < rxr_remaining; v_start++, rxr_idx++)
-			i40evf_map_vector_to_rxq(adapter, v_start, rxr_idx);
+	for (; ridx < rings_remaining; ridx++) {
+		i40evf_map_vector_to_rxq(adapter, vidx, ridx);
+		i40evf_map_vector_to_txq(adapter, vidx, ridx);
 
-		for (; txr_idx < txr_remaining; v_start++, txr_idx++)
-			i40evf_map_vector_to_txq(adapter, v_start, txr_idx);
-		goto out;
-	}
-
-	/* If we don't have enough vectors for a 1-to-1
-	 * mapping, we'll have to group them so there are
-	 * multiple queues per vector.
-	 * Re-adjusting *qpv takes care of the remainder.
-	 */
-	for (i = v_start; i < q_vectors; i++) {
-		rqpv = DIV_ROUND_UP(rxr_remaining, q_vectors - i);
-		for (j = 0; j < rqpv; j++) {
-			i40evf_map_vector_to_rxq(adapter, i, rxr_idx);
-			rxr_idx++;
-			rxr_remaining--;
-		}
-	}
-	for (i = v_start; i < q_vectors; i++) {
-		tqpv = DIV_ROUND_UP(txr_remaining, q_vectors - i);
-		for (j = 0; j < tqpv; j++) {
-			i40evf_map_vector_to_txq(adapter, i, txr_idx);
-			txr_idx++;
-			txr_remaining--;
-		}
+		/* In the case where we have more queues than vectors, continue
+		 * round-robin on vectors until all queues are mapped.
+		 */
+		if (++vidx >= q_vectors)
+			vidx = 0;
 	}
 
-out:
 	adapter->aq_required |= I40EVF_FLAG_AQ_MAP_VECTORS;
 
 	return err;
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (6 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 20:48   ` Bowers, AndrewX
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking Alice Michael
  2017-08-15 17:24 ` [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Bowers, AndrewX
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

From: Alan Brady <alan.brady@intel.com>

Currently the PF allocates a default number of queues for each VF and
cannot be changed.  This patch enables the VF to request a different
number of queues allocated to it.  This patch also adds a new virtchnl
op and capability flag to facilitate this negotiation.

After the PF receives a request message, it will set a requested number
of queues for that VF.  Then when the VF resets, its VSI will get a new
number of queues allocated to it.

This is a best effort request and since we only allocate a guaranteed
default number, if the VF tries to ask for more than the guaranteed
number, there may not be enough in HW to accommodate it unless other
queues for other VFs are freed. It should also be noted decreasing the
number queues allocated to a VF to below the default will NOT enable the
allocation of more than 32 VFs per PF and will not free queues guaranteed
to each VF by default.

Signed-off-by: Alan Brady <alan.brady@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h             |  1 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 75 ++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  1 +
 include/linux/avf/virtchnl.h                       | 20 ++++++
 4 files changed, 97 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 2f1f65e..890508f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -77,6 +77,7 @@
 #define i40e_default_queues_per_vmdq(pf) \
 		(((pf)->hw_features & I40E_HW_RSS_AQ_CAPABLE) ? 4 : 1)
 #define I40E_DEFAULT_QUEUES_PER_VF	4
+#define I40E_MAX_VF_QUEUES		16
 #define I40E_DEFAULT_QUEUES_PER_TC	1 /* should be a power of 2 */
 #define i40e_pf_get_max_q_per_tc(pf) \
 		(((pf)->hw_features & I40E_HW_128_QP_RSS_CAPABLE) ? 128 : 64)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index aa8d30b..7daf6a4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -815,6 +815,14 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
 	 */
 	clear_bit(I40E_VF_STATE_INIT, &vf->vf_states);
 
+	/* It's possible the VF had requeuested more queues than the default so
+	 * do the accounting here when we're about to free them.
+	 */
+	if (vf->num_queue_pairs > I40E_DEFAULT_QUEUES_PER_VF) {
+		pf->queues_left +=
+			vf->num_queue_pairs - I40E_DEFAULT_QUEUES_PER_VF;
+	}
+
 	/* free vsi & disconnect it from the parent uplink */
 	if (vf->lan_vsi_idx) {
 		i40e_vsi_release(pf->vsi[vf->lan_vsi_idx]);
@@ -868,12 +876,27 @@ static int i40e_alloc_vf_res(struct i40e_vf *vf)
 	int total_queue_pairs = 0;
 	int ret;
 
+	if (vf->num_req_queues &&
+	    vf->num_req_queues <= pf->queues_left + I40E_DEFAULT_QUEUES_PER_VF)
+		pf->num_vf_qps = vf->num_req_queues;
+	else
+		pf->num_vf_qps = I40E_DEFAULT_QUEUES_PER_VF;
+
 	/* allocate hw vsi context & associated resources */
 	ret = i40e_alloc_vsi_res(vf, I40E_VSI_SRIOV);
 	if (ret)
 		goto error_alloc;
 	total_queue_pairs += pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs;
 
+	/* We account for each VF to get a default number of queue pairs.  If
+	 * the VF has now requested more, we need to account for that to make
+	 * certain we never request more queues than we actually have left in
+	 * HW.
+	 */
+	if (total_queue_pairs > I40E_DEFAULT_QUEUES_PER_VF)
+		pf->queues_left -=
+			total_queue_pairs - I40E_DEFAULT_QUEUES_PER_VF;
+
 	if (vf->trusted)
 		set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
 	else
@@ -1579,6 +1602,9 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
 					VIRTCHNL_VF_OFFLOAD_WB_ON_ITR;
 	}
 
+	if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)
+		vfres->vf_offload_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;
+
 	vfres->num_vsis = num_vsis;
 	vfres->num_queue_pairs = vf->num_queue_pairs;
 	vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf;
@@ -1987,6 +2013,52 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
 }
 
 /**
+ * i40e_vc_request_queues_msg
+ * @vf: pointer to the VF info
+ * @msg: pointer to the msg buffer
+ * @msglen: msg length
+ *
+ * VFs get a default number of queues but can use this message to request a
+ * different number.  Will respond with either the number requested or the
+ * maximum we can support.
+ **/
+static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg, int msglen)
+{
+	struct virtchnl_vf_res_request *vfres =
+		(struct virtchnl_vf_res_request *)msg;
+	int req_pairs = vfres->num_queue_pairs;
+	int cur_pairs = vf->num_queue_pairs;
+	struct i40e_pf *pf = vf->pf;
+
+	if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states))
+		return -EINVAL;
+
+	if (req_pairs <= 0) {
+		dev_err(&pf->pdev->dev,
+			"VF %d tried to request %d queues.  Ignoring.\n",
+			vf->vf_id, req_pairs);
+	} else if (req_pairs > I40E_MAX_VF_QUEUES) {
+		dev_err(&pf->pdev->dev,
+			"VF %d tried to request more than %d queues.\n",
+			vf->vf_id,
+			I40E_MAX_VF_QUEUES);
+		vfres->num_queue_pairs = I40E_MAX_VF_QUEUES;
+	} else if (req_pairs - cur_pairs > pf->queues_left) {
+		dev_warn(&pf->pdev->dev,
+			 "VF %d requested %d more queues, but only %d left.\n",
+			 vf->vf_id,
+			 req_pairs - cur_pairs,
+			 pf->queues_left);
+		vfres->num_queue_pairs = pf->queues_left + cur_pairs;
+	} else {
+		vf->num_req_queues = req_pairs;
+	}
+
+	return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_REQUEST_QUEUES, 0,
+				      (u8 *)vfres, sizeof(vfres));
+}
+
+/**
  * i40e_vc_get_stats_msg
  * @vf: pointer to the VF info
  * @msg: pointer to the msg buffer
@@ -2648,6 +2720,9 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,
 	case VIRTCHNL_OP_SET_RSS_HENA:
 		ret = i40e_vc_set_rss_hena(vf, msg, msglen);
 		break;
+	case VIRTCHNL_OP_REQUEST_QUEUES:
+		ret = i40e_vc_request_queues_msg(vf, msg, msglen);
+		break;
 
 	case VIRTCHNL_OP_UNKNOWN:
 	default:
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 1f4b0c5..5111d05 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -97,6 +97,7 @@ struct i40e_vf {
 	u16 lan_vsi_id;		/* ID as used by firmware */
 
 	u8 num_queue_pairs;	/* num of qps assigned to VF vsis */
+	u8 num_req_queues;	/* num of requested qps */
 	u64 num_mdd_events;	/* num of mdd events detected */
 	/* num of continuous malformed or invalid msgs detected */
 	u64 num_invalid_msgs;
diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h
index c893b95..35375a0 100644
--- a/include/linux/avf/virtchnl.h
+++ b/include/linux/avf/virtchnl.h
@@ -133,6 +133,7 @@ enum virtchnl_ops {
 	VIRTCHNL_OP_CONFIG_RSS_LUT = 24,
 	VIRTCHNL_OP_GET_RSS_HENA_CAPS = 25,
 	VIRTCHNL_OP_SET_RSS_HENA = 26,
+	VIRTCHNL_OP_REQUEST_QUEUES = 29,
 };
 
 /* This macro is used to generate a compilation error if a structure
@@ -233,6 +234,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);
 #define VIRTCHNL_VF_OFFLOAD_RSS_AQ		0x00000008
 #define VIRTCHNL_VF_OFFLOAD_RSS_REG		0x00000010
 #define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR		0x00000020
+#define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES		0x00000040
 #define VIRTCHNL_VF_OFFLOAD_VLAN		0x00010000
 #define VIRTCHNL_VF_OFFLOAD_RX_POLLING		0x00020000
 #define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2	0x00040000
@@ -323,6 +325,21 @@ struct virtchnl_vsi_queue_config_info {
 	struct virtchnl_queue_pair_info qpair[1];
 };
 
+/* VIRTCHNL_OP_REQUEST_QUEUES
+ * VF sends this message to request the PF to allocate additional queues to
+ * this VF.  Each VF gets a guaranteed number of queues on init but asking for
+ * additional queues must be negotiated.  This is a best effort request as it
+ * is possible the PF does not have enough queues left to support the request.
+ * If the PF cannot support the number requested it will respond with the
+ * maximum number it is able to support; otherwise it will respond with the
+ * number requested.
+ */
+
+/* VF resource request */
+struct virtchnl_vf_res_request {
+	u16 num_queue_pairs;
+};
+
 VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_vsi_queue_config_info);
 
 /* VIRTCHNL_OP_CONFIG_IRQ_MAP
@@ -686,6 +703,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
 	case VIRTCHNL_OP_SET_RSS_HENA:
 		valid_len = sizeof(struct virtchnl_rss_hena);
 		break;
+	case VIRTCHNL_OP_REQUEST_QUEUES:
+		valid_len = sizeof(struct virtchnl_vf_res_request);
+		break;
 	/* These are always errors coming from the VF. */
 	case VIRTCHNL_OP_EVENT:
 	case VIRTCHNL_OP_UNKNOWN:
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (7 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues Alice Michael
@ 2017-07-14 13:27 ` Alice Michael
  2017-07-21 20:49   ` Bowers, AndrewX
  2017-08-15 17:24 ` [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Bowers, AndrewX
  9 siblings, 1 reply; 20+ messages in thread
From: Alice Michael @ 2017-07-14 13:27 UTC (permalink / raw)
  To: intel-wired-lan

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

The i40e driver now supports two different devices with two different
firmware versions. So be smart about how we handle these. Move the FW
version macros to the appropriate header file, and add a convenience
macro that checks the version based on the device. Then use this macro
to check whether or not the driver can use the new link info API.

Testing Hints (required if no HSD): Compile, load on both X710 and X722
and make sure it doesn't complain about API version on latest FW.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h   | 10 +++++++++-
 drivers/net/ethernet/intel/i40e/i40e_common.c       |  6 ++++--
 drivers/net/ethernet/intel/i40e/i40e_main.c         |  2 +-
 drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 10 +++++++++-
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 5d5f422..e2a9ec8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -34,7 +34,15 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR	0x0005
+#define I40E_FW_API_VERSION_MINOR_X722	0x0005
+#define I40E_FW_API_VERSION_MINOR_X710	0x0007
+
+#define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
+					I40E_FW_API_VERSION_MINOR_X710 : \
+					I40E_FW_API_VERSION_MINOR_X722)
+
+/* API version 1.7 implements additional link and PHY-specific APIs  */
+#define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
 
 struct i40e_aq_desc {
 	__le16 flags;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 111426b..f01a54a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1593,8 +1593,10 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
 		status = I40E_ERR_UNKNOWN_PHY;
 
 	if (report_init) {
-		hw->phy.phy_types = le32_to_cpu(abilities->phy_type);
-		hw->phy.phy_types |= ((u64)abilities->phy_type_ext << 32);
+		if (hw->mac.type ==  I40E_MAC_XL710 &&
+		    hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+		    hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
+			status = i40e_aq_get_link_info(hw, true, NULL, NULL);
 	}
 
 	return status;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 1ad014d..fb0c8c6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11420,7 +11420,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		 i40e_nvm_version_str(hw));
 
 	if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
-	    hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR)
+	    hw->aq.api_min_ver > I40E_FW_MINOR_VERSION(hw))
 		dev_info(&pdev->dev,
 			 "The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.\n");
 	else if (hw->aq.api_maj_ver == 1 && hw->aq.api_min_ver < 4)
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
index 83e63e5..f9f48d1 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
@@ -34,7 +34,15 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR	0x0005
+#define I40E_FW_API_VERSION_MINOR_X722	0x0005
+#define I40E_FW_API_VERSION_MINOR_X710	0x0007
+
+#define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
+					I40E_FW_API_VERSION_MINOR_X710 : \
+					I40E_FW_API_VERSION_MINOR_X722)
+
+/* API version 1.7 implements additional link and PHY-specific APIs  */
+#define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
 
 struct i40e_aq_desc {
 	__le16 flags;
-- 
2.9.3


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

* [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level Alice Michael
@ 2017-07-21 18:00   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 18:00 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Williams, Mitch A <mitch.a.williams@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message
> level
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> We see this message regularly on VF reset or unload (which invokes a reset).
> It's essentially meaningless unless it's happening constantly.
> To prevent consternation, lower the log level to debug so it's not seen under
> normal circumstance.
> 
> Testing Hints (required if no HSD): Load and unload VF driver, observe dmesg
> in VM.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> ---
>  drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup Alice Michael
@ 2017-07-21 18:03   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 18:03 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state
> bit for miscellaneous IRQ setup
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> We currently (mis)use the __I40E_RECOVERY_PENDING bit to determine
> when we should actually request a new IRQ in i40e_setup_misc_vector().
> 
> This led to a design mistake where we open-coded the re-setup of the
> miscellaneous vector in i40e_resume() instead of using the function
> provided. If we did not open-code this and instead tried to use the
> i40e_setup_misc_vector() function, it would lead to never reallocating the
> IRQ.
> 
> This would lead to a second i40e_suspend() call failing to free the vector due
> to a NULL pointer dereference.
> 
> A future patch is going to re-work how the i40e_suspend() and
> i40e_resume() flows work to clear all IRQ vectors, which would require us to
> use i40e_setup_misc_vector() directly. Since during this time the
> __I40E_RECOVERY_PENDING bit is set, we'll never re-allocate the vector.
> 
> Rather than leaving the open-coded setup in i40e_resume() lets just fix the
> problem properly in i40e_setup_misc_vector().
> 
> Introduce a new state bit which indicates when the IRQ has been assigned,
> which will be set when i40e_setup_misc_vector is first called.
> This ultimately resolves the issue of re-requesting the vector, without
> overloading the __I40E_RECOVERY_PENDING state. This ensures that the
> suspend/resume cycle can use the setup function instead of open-coding
> the re-request during resume.
> 
> Additionally, since the only callers of i40e_stop_misc_vector also want to
> free it, move this code directly into the function to avoid duplication. Due to
> the new functionality, rename it to i40e_free_misc_vector().
> 
> This lets us drop the extra calls to free and re-enable the vector during
> i40e_suspend() and i40e_resume(). We don't need to call
> i40e_setup_misc_Vector() in i40e_resume() because it gets called by the
> i40e_rebuild() call.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h      |  1 +
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 39 +++++++++++---------------
> ---
>  2 files changed, 15 insertions(+), 25 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks Alice Michael
@ 2017-07-21 18:50   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 18:50 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic
> PM support instead of legacy PM callbacks
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Stop using the old legacy PM support, since we now have stable support for
> the newer generic PM callbacks.
> 
> This has several advantages. First, we no longer have to manage our own
> pci_save_state() and power changes, as it's preferred to have the PCI stack
> do this. Second, these routines get called for both hibernate and suspend to
> ram, so we can have the driver properly handle all the suspend/resume
> flows that it needs to.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 54 +++++++++------------------
> --
>  1 file changed, 17 insertions(+), 37 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming Alice Michael
@ 2017-07-21 18:51   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 18:51 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear
> suspended state until we finish resuming
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> When handling suspend and resume callbacks we want to make sure that (a)
> we don't suspend again if we're already suspended and (b) we don't resume
> again if we're already resuming. Lets make sure we test_and_set the
> __I40E_SUSPENDED bit in i40e_suspend which ensures that a suspend call
> when already suspended will exit early. Additionally, if __I40E_SUSPENDED is
> not set when we begin resuming, exit early as well.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended Alice Michael
@ 2017-07-21 20:45   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 20:45 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service
> task from running while we're suspended
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Although the service task does check the suspended status before running, it
> might already be part way through running when we go to suspend. Lets
> ensure that the service task is stopped and will not be restarted again until
> we finish resuming. This ensures that service task code does not cause
> strange interactions with the suspend/resume handlers.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended Alice Michael
@ 2017-07-21 20:47   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 20:47 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs
> and disable MSI-X when suspended
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> On some platforms with a large number of CPUs, we will allocate many IRQ
> vectors. When hibernating, the system will attempt to migrate all of the
> vectors back to CPU0 when shutting down all the other CPUs. It is possible
> that we have so many vectors that it cannot re-assign them to CPU0. This is
> even more likely if we have many devices installed in one platform.
> 
> The end result is failure to hibernate, as it is not possible to shutdown the
> CPUs. We can avoid this by disabling MSI-X and clearing our interrupt scheme
> when the device is suspended. A more ideal solution would be some method
> for the stack to properly handle this for all drivers, rather than on a case-by-
> case basis for each driver to fix itself.
> 
> However, until this more ideal solution exists, we can do our part and
> shutdown our IRQs during suspend, which should allow systems with a large
> number of CPUs to safely suspend or hibernate.
> 
> It may be worth investigating if we should shut down even further when we
> suspend as it may make the path cleaner, but this was the minimum fix for
> the hibernation issue mentioned here.
> 
> Testing-hints:
>   This affects systems with a large number of CPUs, and with multiple
>   devices enabled. Without this change, those platforms are unable to
>   hibernate at all.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 68
> ++++++++++++++++++++++++-
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c |  2 +-
>  2 files changed, 68 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping Alice Michael
@ 2017-07-21 20:47   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 20:47 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector
> mapping
> 
> From: Alan Brady <alan.brady@intel.com>
> 
> The current implementation for mapping queues to vectors is broken
> because it attempts to map each tx and rx ring to its own vector, however we
> use combined queues so we should actually be mapping the tx/rx rings
> together on one vector.
> 
> Also in the current implementation, in the case where we have more queues
> than vectors, we attempt to group the queues together into 'chunks' and
> map each 'chunk' of queues to a vector.  Chunking them together would be
> more ideal if, and only if, we only had RSS because of the way the hashing
> algorithm works but in the case of a future patch that enables VF ADq, round
> robin assignment is better and still works with RSS.
> 
> This patch resolves both those issues and simplifies the code needed to
> accomplish this.  Instead of treating the case where we have more queues
> than vectors as special, if we notice our vector index is greater than vectors,
> reset the vector index to zero and continue mapping.  This should ensure
> that in both cases, whether we have enough vectors for each queue or not,
> the queues get appropriately mapped.
> 
> Testing-hints:
>     Make sure traffic continues to be received and features like RSS
>     continue to work as expected.
> 
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> ---
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 48 ++++++------------------
> -
>  1 file changed, 10 insertions(+), 38 deletions(-)


Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues Alice Michael
@ 2017-07-21 20:48   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 20:48 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to
> negotiate number of allocated queues
> 
> From: Alan Brady <alan.brady@intel.com>
> 
> Currently the PF allocates a default number of queues for each VF and
> cannot be changed.  This patch enables the VF to request a different number
> of queues allocated to it.  This patch also adds a new virtchnl op and capability
> flag to facilitate this negotiation.
> 
> After the PF receives a request message, it will set a requested number of
> queues for that VF.  Then when the VF resets, its VSI will get a new number
> of queues allocated to it.
> 
> This is a best effort request and since we only allocate a guaranteed default
> number, if the VF tries to ask for more than the guaranteed number, there
> may not be enough in HW to accommodate it unless other queues for other
> VFs are freed. It should also be noted decreasing the number queues
> allocated to a VF to below the default will NOT enable the allocation of more
> than 32 VFs per PF and will not free queues guaranteed to each VF by
> default.
> 
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h             |  1 +
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 75
> ++++++++++++++++++++++
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  1 +
>  include/linux/avf/virtchnl.h                       | 20 ++++++
>  4 files changed, 97 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking Alice Michael
@ 2017-07-21 20:49   ` Bowers, AndrewX
  0 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-07-21 20:49 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Williams, Mitch A <mitch.a.williams@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW
> version checking
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> The i40e driver now supports two different devices with two different
> firmware versions. So be smart about how we handle these. Move the FW
> version macros to the appropriate header file, and add a convenience macro
> that checks the version based on the device. Then use this macro to check
> whether or not the driver can use the new link info API.
> 
> Testing Hints (required if no HSD): Compile, load on both X710 and X722 and
> make sure it doesn't complain about API version on latest FW.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h   | 10 +++++++++-
>  drivers/net/ethernet/intel/i40e/i40e_common.c       |  6 ++++--
>  drivers/net/ethernet/intel/i40e/i40e_main.c         |  2 +-
>  drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 10 +++++++++-
>  4 files changed, 23 insertions(+), 5 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected
  2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
                   ` (8 preceding siblings ...)
  2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking Alice Michael
@ 2017-08-15 17:24 ` Bowers, AndrewX
  9 siblings, 0 replies; 20+ messages in thread
From: Bowers, AndrewX @ 2017-08-15 17:24 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:27 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Stachura, Mariusz <mariusz.stachura@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow
> director counters not wrapping as expected
> 
> From: Mariusz Stachura <mariusz.stachura@intel.com>
> 
> An eratta with GLQF_PCNT causes it to not wrap as expected. This can cause
> an error in flow director statistics. This patch resets affected counters just
> after reading.
> 
> Testing Hints (required if no HSD): DCR 2187
> 
> Signed-off-by: Mariusz Stachura <mariusz.stachura@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 35 +++++++++++++++++++--
> --------
>  1 file changed, 23 insertions(+), 12 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

end of thread, other threads:[~2017-08-15 17:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 13:27 [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Alice Michael
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 02/10] i40evf: lower message level Alice Michael
2017-07-21 18:00   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 03/10] i40e: use separate state bit for miscellaneous IRQ setup Alice Michael
2017-07-21 18:03   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 04/10] i40e: use newer generic PM support instead of legacy PM callbacks Alice Michael
2017-07-21 18:50   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 05/10] i40e: don't clear suspended state until we finish resuming Alice Michael
2017-07-21 18:51   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 06/10] i40e: prevent service task from running while we're suspended Alice Michael
2017-07-21 20:45   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 07/10] i40e: shutdown all IRQs and disable MSI-X when suspended Alice Michael
2017-07-21 20:47   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 08/10] i40evf: fix ring to vector mapping Alice Michael
2017-07-21 20:47   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 09/10] i40e: Enable VF to negotiate number of allocated queues Alice Michael
2017-07-21 20:48   ` Bowers, AndrewX
2017-07-14 13:27 ` [Intel-wired-lan] [next PATCH S77-V3 10/10] i40e: refactor FW version checking Alice Michael
2017-07-21 20:49   ` Bowers, AndrewX
2017-08-15 17:24 ` [Intel-wired-lan] [next PATCH S77-V3 01/10] i40e: fix for flow director counters not wrapping as expected Bowers, AndrewX

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.