netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Shannon Nelson <shannon.nelson@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next v2 02/12] i40e: fix pf reset after offline test
Date: Mon, 16 Dec 2013 01:38:48 -0800	[thread overview]
Message-ID: <1387186738-13666-3-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1387186738-13666-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

When the ethtool testing starts it sets the I40E_TESTING state
bit, which blocks new netdev opens so that things don't get
confused, while the testing might be messing with register and
other things.  Unfortunately, that was keeping the PF resets
after the register test from working correctly because the netdev
would not get reopened.  This patch reorders the tests to put the
register test last as it is the only one that needs a reset, and
we wait to trigger the reset until after we clear the
I40E_TESTING bit.

Change-Id: Ieaa18d74264250ac336b0656b490125ee8a22d2a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index eb34375..9c380a8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -748,7 +748,6 @@ static int i40e_reg_test(struct net_device *netdev, u64 *data)
 	netif_info(pf, hw, netdev, "register test\n");
 	*data = i40e_diag_reg_test(&pf->hw);
 
-	i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
 	return *data;
 }
 
@@ -796,20 +795,18 @@ static void i40e_diag_test(struct net_device *netdev,
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
 
-	set_bit(__I40E_TESTING, &pf->state);
 	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
 		/* Offline tests */
 		netif_info(pf, drv, netdev, "offline testing starting\n");
 
+		set_bit(__I40E_TESTING, &pf->state);
+
 		/* Link test performed before hardware reset
 		 * so autoneg doesn't interfere with test result
 		 */
 		if (i40e_link_test(netdev, &data[I40E_ETH_TEST_LINK]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
-		if (i40e_reg_test(netdev, &data[I40E_ETH_TEST_REG]))
-			eth_test->flags |= ETH_TEST_FL_FAILED;
-
 		if (i40e_eeprom_test(netdev, &data[I40E_ETH_TEST_EEPROM]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
@@ -819,6 +816,12 @@ static void i40e_diag_test(struct net_device *netdev,
 		if (i40e_loopback_test(netdev, &data[I40E_ETH_TEST_LOOPBACK]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
+		/* run reg test last, a reset is required after it */
+		if (i40e_reg_test(netdev, &data[I40E_ETH_TEST_REG]))
+			eth_test->flags |= ETH_TEST_FL_FAILED;
+
+		clear_bit(__I40E_TESTING, &pf->state);
+		i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
 	} else {
 		/* Online tests */
 		netif_info(pf, drv, netdev, "online testing starting\n");
@@ -832,7 +835,6 @@ static void i40e_diag_test(struct net_device *netdev,
 		data[I40E_ETH_TEST_INTR] = 0;
 		data[I40E_ETH_TEST_LOOPBACK] = 0;
 	}
-	clear_bit(__I40E_TESTING, &pf->state);
 
 	netif_info(pf, drv, netdev, "testing finished\n");
 }
-- 
1.8.3.1

  parent reply	other threads:[~2013-12-16  9:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  9:38 [net-next v2 00/12][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 01/12] i40e: fix up some of the ethtool connection reporting Jeff Kirsher
2013-12-16  9:38 ` Jeff Kirsher [this message]
2013-12-16  9:38 ` [net-next v2 03/12] i40e: Tell the stack about our actual number of queues Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 04/12] i40e: init flow control settings to disabled Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 05/12] i40e: trivial fixes Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 06/12] i40e: use same number of queues as CPUs Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 07/12] i40e: reinit flow for the main VSI Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 08/12] i40e: function to reconfigure RSS queues and rebuild Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 09/12] i40e: Add basic support for get/set channels for RSS Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 10/12] i40e: rtnl_lock in reset path fixes Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 11/12] i40e: support for suspend and resume Jeff Kirsher
2013-12-16  9:38 ` [net-next v2 12/12] i40e: Remove FCoE in i40e_virtchnl_pf.c code Jeff Kirsher
2013-12-17 19:31 ` [net-next v2 00/12][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=1387186738-13666-3-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=shannon.nelson@intel.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;
as well as URLs for NNTP newsgroup(s).