netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mitch Williams <mitch.a.williams@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 04/14] i40evf: return more useful error information
Date: Thu, 26 Jun 2014 05:13:43 -0700	[thread overview]
Message-ID: <1403784834-23301-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1403784834-23301-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

When verifying the API version (which is the first time the driver
communicates with the firmware and thus the PF driver), there are many
ways in which a failure can occur. There may be an error from the
firmware, there may be unresponsive firmware, there may be an error from
the PF driver, etc, etc.

Make this function return more useful information, instead of just -EIO.
Propagate FW errors back to the caller, and log a message if the PF
sends an invalid reply.

Change-ID: I3e9135a2b80f7acdb855f62f12b2b2668c9a8951
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 2dc0bac..0ed2ad7 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -80,8 +80,9 @@ int i40evf_send_api_ver(struct i40evf_adapter *adapter)
  * @adapter: adapter structure
  *
  * Compare API versions with the PF. Must be called after admin queue is
- * initialized. Returns 0 if API versions match, -EIO if
- * they do not, or I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty.
+ * initialized. Returns 0 if API versions match, -EIO if they do not,
+ * I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty, and any errors
+ * from the firmware are propagated.
  **/
 int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
 {
@@ -102,13 +103,13 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
 		goto out_alloc;
 
 	err = (i40e_status)le32_to_cpu(event.desc.cookie_low);
-	if (err) {
-		err = -EIO;
+	if (err)
 		goto out_alloc;
-	}
 
 	if ((enum i40e_virtchnl_ops)le32_to_cpu(event.desc.cookie_high) !=
 	    I40E_VIRTCHNL_OP_VERSION) {
+		dev_info(&adapter->pdev->dev, "Invalid reply type %d from PF\n",
+			 le32_to_cpu(event.desc.cookie_high));
 		err = -EIO;
 		goto out_alloc;
 	}
-- 
1.9.3

  parent reply	other threads:[~2014-06-26 12:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 12:13 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2014-06-26 Jeff Kirsher
2014-06-26 12:13 ` [net-next 01/14] i40e: do not take NVM ownership for SR read Jeff Kirsher
2014-06-26 12:13 ` [net-next 02/14] i40e/i40evf: Big endian fixes for handling HMC Jeff Kirsher
2014-06-26 12:13 ` [net-next 03/14] i40evf: don't stop watchdog if it hasn't started Jeff Kirsher
2014-06-26 12:13 ` Jeff Kirsher [this message]
2014-06-26 12:13 ` [net-next 05/14] i40evf: fix typo Jeff Kirsher
2014-06-26 12:13 ` [net-next 06/14] i40evf: resend FW request if no response Jeff Kirsher
2014-06-26 12:13 ` [net-next 07/14] i40e: rename i40e_ptp_enable to i40e_ptp_feature_enable Jeff Kirsher
2014-06-26 12:13 ` [net-next 08/14] i40e: break PTP hardware control from ioctl command for timestamp mode Jeff Kirsher
2014-06-26 12:13 ` [net-next 09/14] i40e: don't store user requested mode until we've validated it Jeff Kirsher
2014-06-26 12:13 ` [net-next 10/14] i40e: only create PTP device node once Jeff Kirsher
2014-06-26 12:13 ` [net-next 11/14] i40e: Avoid adding the TCP-IPv4 filter twice Jeff Kirsher
2014-06-26 12:13 ` [net-next 12/14] i40e: Fix the FD sideband logic to detect a FD table full condition Jeff Kirsher
2014-06-26 12:13 ` [net-next 13/14] i40e: Add debugfs hooks to print current total FD filter count Jeff Kirsher
2014-06-26 12:13 ` [net-next 14/14] i40e: fix fdir programming Jeff Kirsher
2014-06-26 12:13 ` [net-next 15/15] i40e/i40evf: Bump i40e to 0.4.18 and i40evf to 0.9.37 Jeff Kirsher
2014-06-27 19:59 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2014-06-26 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=1403784834-23301-5-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=mitch.a.williams@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 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).