All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Greg Rose <gregory.v.rose@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Catherine Sullivan <catherine.sullivan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 03/16] i40e: Reset the VF upon conflicting VLAN configuration
Date: Tue, 22 Apr 2014 05:39:18 -0700	[thread overview]
Message-ID: <1398170371-3333-4-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1398170371-3333-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

If a host VMM administrator hoses his VF by assigning a port VLAN after
it is already up and running with implicit permission to set local
VLANs then we print a message warning the host administrator that the
VF driver needs to be reloaded.

In addition we need to knock the VF offline so that it does not continue
to receive traffic not on the port VLAN assigned to it.  So we reset the
VF.  The VF will cease operation and the administrator will be forced to
unload and reload the VF driver to make it work again.

Change-ID: Iae1ae006b244e74e30a4ee546b3c5fca5cfb40aa
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 26 +++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 02c11a7..e3e4df0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -29,6 +29,24 @@
 /***********************misc routines*****************************/
 
 /**
+ * i40e_vc_disable_vf
+ * @pf: pointer to the pf info
+ * @vf: pointer to the vf info
+ *
+ * Disable the VF through a SW reset
+ **/
+static inline void i40e_vc_disable_vf(struct i40e_pf *pf, struct i40e_vf *vf)
+{
+	struct i40e_hw *hw = &pf->hw;
+	u32 reg;
+
+	reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id));
+	reg |= I40E_VPGEN_VFRTRIG_VFSWR_MASK;
+	wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
+	i40e_flush(hw);
+}
+
+/**
  * i40e_vc_isvalid_vsi_id
  * @vf: pointer to the vf info
  * @vsi_id: vf relative vsi id
@@ -2088,10 +2106,16 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 		goto error_pvid;
 	}
 
-	if (vsi->info.pvid == 0 && i40e_is_vsi_in_vlan(vsi))
+	if (vsi->info.pvid == 0 && i40e_is_vsi_in_vlan(vsi)) {
 		dev_err(&pf->pdev->dev,
 			"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
 			vf_id);
+		/* Administrator Error - knock the VF offline until he does
+		 * the right thing by reconfiguring his network correctly
+		 * and then reloading the VF driver.
+		 */
+		i40e_vc_disable_vf(pf, vf);
+	}
 
 	/* Check for condition where there was already a port VLAN ID
 	 * filter set and now it is being deleted by setting it to zero.
-- 
1.9.0

  parent reply	other threads:[~2014-04-22 12:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 12:39 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-04-22 12:39 ` [net-next 01/16] i40e: Add bridge FDB add/del/dump ops Jeff Kirsher
2014-04-22 12:39 ` [net-next 02/16] i40e/i40evf: unhide and enable to one prefena field Jeff Kirsher
2014-04-22 12:39 ` Jeff Kirsher [this message]
2014-04-22 12:39 ` [net-next 04/16] i40e: Enable VF Tx bandwidth setting Jeff Kirsher
2014-04-22 12:39 ` [net-next 05/16] i40e/i40evf: Bump build versions Jeff Kirsher
2014-04-22 12:39 ` [net-next 06/16] i40e: Remove a FW workaround Jeff Kirsher
2014-04-22 12:39 ` [net-next 07/16] i40e: Fix an issue with displaying IPv4 FD filters Jeff Kirsher
2014-04-22 12:39 ` [net-next 08/16] i40e/i40evf: add tracking to NVM busy state Jeff Kirsher
2014-04-22 12:39 ` [net-next 09/16] i40e/i40evf: update AdminQ API Jeff Kirsher
2014-04-22 12:39 ` [net-next 10/16] i40e: prep vsi_open logic for non-netdev cases Jeff Kirsher
2014-04-22 12:39 ` [net-next 11/16] i40e: abstract the close path for better netdev vsis Jeff Kirsher
2014-04-22 12:39 ` [net-next 12/16] i40e: use generic vsi_open to unquiesce vsi Jeff Kirsher
2014-04-22 12:39 ` [net-next 13/16] i40e: rework fdir setup and teardown Jeff Kirsher
2014-04-22 12:39 ` [net-next 14/16] i40e: Cleanup if/else statements Jeff Kirsher
2014-04-22 12:39 ` [net-next 15/16] i40e: Tweak for-loop in i40e_ethtool.c Jeff Kirsher
2014-04-22 12:39 ` [net-next 16/16] i40e/i40evf: Bump build versions Jeff Kirsher
2014-04-23  1:47 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates 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=1398170371-3333-4-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=catherine.sullivan@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=gregory.v.rose@intel.com \
    --cc=netdev@vger.kernel.org \
    --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 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.