From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Brett Creeley <brett.creeley@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 08/11] ice: Call pci_disable_sriov before stopping queues for VF
Date: Tue, 13 Nov 2018 10:32:36 -0800 [thread overview]
Message-ID: <20181113183239.5861-9-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20181113183239.5861-1-jeffrey.t.kirsher@intel.com>
From: Brett Creeley <brett.creeley@intel.com>
Previous to this commit the driver was immediately stopping Tx/Rx
queues when doing the following "echo 0 > sriov_numvfs" and then it was
calling pci_disable_sriov if the VFs are not assigned. This was causing
the VIRTCHNL_OP_DISABLE_QUEUES to fail because it was trying to stop
the queues for a second time.
Fix this by calling pci_disable_sriov before stopping the Tx/Rx queues.
This allows the VIRTCHNL_OP_DISABLE_QUEUES to get processed before the
driver tries to stop the Rx/Tx queues in ice_free_vfs.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
.../net/ethernet/intel/ice/ice_virtchnl_pf.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index e71065f9d391..20b94dee0036 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -215,6 +215,15 @@ void ice_free_vfs(struct ice_pf *pf)
while (test_and_set_bit(__ICE_VF_DIS, pf->state))
usleep_range(1000, 2000);
+ /* Disable IOV before freeing resources. This lets any VF drivers
+ * running in the host get themselves cleaned up before we yank
+ * the carpet out from underneath their feet.
+ */
+ if (!pci_vfs_assigned(pf->pdev))
+ pci_disable_sriov(pf->pdev);
+ else
+ dev_warn(&pf->pdev->dev, "VFs are assigned - not disabling SR-IOV\n");
+
/* Avoid wait time by stopping all VFs at the same time */
for (i = 0; i < pf->num_alloc_vfs; i++) {
if (!test_bit(ICE_VF_STATE_ENA, pf->vf[i].vf_states))
@@ -228,15 +237,6 @@ void ice_free_vfs(struct ice_pf *pf)
clear_bit(ICE_VF_STATE_ENA, pf->vf[i].vf_states);
}
- /* Disable IOV before freeing resources. This lets any VF drivers
- * running in the host get themselves cleaned up before we yank
- * the carpet out from underneath their feet.
- */
- if (!pci_vfs_assigned(pf->pdev))
- pci_disable_sriov(pf->pdev);
- else
- dev_warn(&pf->pdev->dev, "VFs are assigned - not disabling SR-IOV\n");
-
tmp = pf->num_alloc_vfs;
pf->num_vf_qps = 0;
pf->num_alloc_vfs = 0;
--
2.19.1
next prev parent reply other threads:[~2018-11-14 4:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 18:32 [net-next 00/11][pull request] 100GbE Intel Wired LAN Driver Updates 2018-11-13 Jeff Kirsher
2018-11-13 18:32 ` [net-next 01/11] ice: Fix debug print in ice_tx_timeout Jeff Kirsher
2018-11-13 18:32 ` [net-next 02/11] ice: Check for q_vector when stopping rings Jeff Kirsher
2018-11-13 18:32 ` [net-next 03/11] ice: Remove node before releasing VSI Jeff Kirsher
2018-11-13 18:32 ` [net-next 04/11] ice: Calculate guaranteed VSIs per function and use it Jeff Kirsher
2018-11-13 18:32 ` [net-next 05/11] ice: Avoid nested RTNL locking in ice_dis_vsi Jeff Kirsher
2018-11-13 18:32 ` [net-next 06/11] ice: Fix NVM mask defines Jeff Kirsher
2018-11-13 18:32 ` [net-next 07/11] ice: Increase Rx queue disable timeout Jeff Kirsher
2018-11-13 18:32 ` Jeff Kirsher [this message]
2018-11-13 18:32 ` [net-next 09/11] ice: Fix to make VLAN priority tagged traffic to appear on all TCs Jeff Kirsher
2018-11-13 18:32 ` [net-next 10/11] ice: Destroy scheduler tree in reset path Jeff Kirsher
2018-11-13 18:32 ` [net-next 11/11] ice: Remove ICE_MAX_TXQ_PER_TXQG check when configuring Tx queue Jeff Kirsher
2018-11-15 19:24 ` [net-next 00/11][pull request] 100GbE Intel Wired LAN Driver Updates 2018-11-13 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181113183239.5861-9-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=anirudh.venkataramanan@intel.com \
--cc=brett.creeley@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox