aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2014-06-04 20:09:17 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-06-26 07:44:58 -0400
commit6a8e93db98e36b5b3b8c10b9adae073d6bd1062a (patch)
tree9d3765b1b4ca29e0740ad5ebc81ed3743e3d5deb
parente5d17c3ed2cf0485c6b85d783e1d20a8cfad93c1 (diff)
i40evf: return more useful error information
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>
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c11
1 files 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 2dc0bac76717..0ed2ad7e4eee 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)
80 * @adapter: adapter structure 80 * @adapter: adapter structure
81 * 81 *
82 * Compare API versions with the PF. Must be called after admin queue is 82 * Compare API versions with the PF. Must be called after admin queue is
83 * initialized. Returns 0 if API versions match, -EIO if 83 * initialized. Returns 0 if API versions match, -EIO if they do not,
84 * they do not, or I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty. 84 * I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty, and any errors
85 * from the firmware are propagated.
85 **/ 86 **/
86int i40evf_verify_api_ver(struct i40evf_adapter *adapter) 87int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
87{ 88{
@@ -102,13 +103,13 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
102 goto out_alloc; 103 goto out_alloc;
103 104
104 err = (i40e_status)le32_to_cpu(event.desc.cookie_low); 105 err = (i40e_status)le32_to_cpu(event.desc.cookie_low);
105 if (err) { 106 if (err)
106 err = -EIO;
107 goto out_alloc; 107 goto out_alloc;
108 }
109 108
110 if ((enum i40e_virtchnl_ops)le32_to_cpu(event.desc.cookie_high) != 109 if ((enum i40e_virtchnl_ops)le32_to_cpu(event.desc.cookie_high) !=
111 I40E_VIRTCHNL_OP_VERSION) { 110 I40E_VIRTCHNL_OP_VERSION) {
111 dev_info(&adapter->pdev->dev, "Invalid reply type %d from PF\n",
112 le32_to_cpu(event.desc.cookie_high));
112 err = -EIO; 113 err = -EIO;
113 goto out_alloc; 114 goto out_alloc;
114 } 115 }