netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shradha Shah <sshah@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next v2 12/14] sfc: do not allow VFs to be destroyed if assigned to guests
Date: Mon, 1 Jun 2015 14:03:20 +0100	[thread overview]
Message-ID: <556C5818.2030409@solarflare.com> (raw)
In-Reply-To: <556C5704.4060901@solarflare.com>

From: Daniel Pieczko <dpieczko@solarflare.com>

Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10_sriov.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index cd52454..083c534 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -417,6 +417,15 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx)
 {
 	struct pci_dev *dev = efx->pci_dev;
 
+	if (!efx->vf_count)
+		return 0;
+
+	if (pci_vfs_assigned(dev)) {
+		netif_err(efx, drv, efx->net_dev, "VFs are assigned to guests; "
+			  "please detach them before disabling SR-IOV\n");
+		return -EBUSY;
+	}
+
 	pci_disable_sriov(dev);
 	efx_ef10_sriov_free_vf_vswitching(efx);
 	efx->vf_count = 0;

  parent reply	other threads:[~2015-06-01 13:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:58 [PATCH net-next v2 00/14] sfc: ndo_get_phys_port_id, vadaptor stats and PF unload when Vf's assigned to guest Shradha Shah
2015-06-01 13:00 ` [PATCH net-next v2 01/14] sfc: Add code to export port_num in netdev->dev_port Shradha Shah
2015-06-01 19:01   ` David Miller
2015-06-02  9:14     ` Shradha Shah
2015-06-01 13:00 ` [PATCH net-next v2 02/14] sfc: Add sysfs entry for flags (link control and primary) Shradha Shah
2015-06-01 13:01 ` [PATCH net-next v2 03/14] sfc: Implement ndo_gets_phys_port_id() for EF10 VFs Shradha Shah
2015-06-01 13:01 ` [PATCH net-next v2 04/14] sfc: add "port_" prefix to MAC stats Shradha Shah
2015-06-01 13:01 ` [PATCH net-next v2 05/14] sfc: set the port-id when calling MC_CMD_MAC_STATS Shradha Shah
2015-06-01 13:01 ` [PATCH net-next v2 06/14] sfc: display vadaptor statistics for all interfaces Shradha Shah
2015-06-01 13:02 ` [PATCH net-next v2 07/14] sfc: DMA the VF stats only when requested Shradha Shah
2015-06-01 13:02 ` [PATCH net-next v2 08/14] sfc: update netdevice statistics to use vadaptor stats Shradha Shah
2015-06-01 13:02 ` [PATCH net-next v2 09/14] sfc: suppress ENOENT error messages from MC_CMD_MAC_STATS Shradha Shah
2015-06-01 13:02 ` [PATCH net-next v2 10/14] sfc: suppress vadaptor stats when EVB is not present Shradha Shah
2015-06-01 13:03 ` [PATCH net-next v2 11/14] sfc: don't update stats on VF when called in atomic context Shradha Shah
2015-06-01 13:03 ` Shradha Shah [this message]
2015-06-01 13:03 ` [PATCH net-next v2 13/14] sfc: force removal of VF and vport on driver removal Shradha Shah
2015-06-01 13:03 ` [PATCH net-next v2 14/14] sfc: leak vports if a VF is assigned during PF unload Shradha Shah

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=556C5818.2030409@solarflare.com \
    --to=sshah@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).