Skip to content

Commit

Permalink
net/i40e/base: fix retrying logic
Browse files Browse the repository at this point in the history
[ upstream commit 5012693 ]

Fixed a bug where driver was breaking out of the loop and
reporting an error without retrying first.

Fixes: 466eec7 ("net/i40e/base: retry AQC to overcome IRCRead hangs")

Signed-off-by: Marcin Formela <marcin.formela@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  • Loading branch information
0day-trouble-maker authored and kevintraynor committed Feb 7, 2020
1 parent 5244701 commit 601bb85
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/net/i40e/base/i40e_common.c
Expand Up @@ -1702,19 +1702,22 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
status = i40e_asq_send_command(hw, &desc, abilities,
abilities_size, cmd_details);

if (status != I40E_SUCCESS)
break;

if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) {
switch (hw->aq.asq_last_status) {
case I40E_AQ_RC_EIO:
status = I40E_ERR_UNKNOWN_PHY;
break;
} else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) {
case I40E_AQ_RC_EAGAIN:
i40e_msec_delay(1);
total_delay++;
status = I40E_ERR_TIMEOUT;
break;
/* also covers I40E_AQ_RC_OK */
default:
break;
}
} while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) &&
(total_delay < max_delay));

} while ((hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) &&
(total_delay < max_delay));

if (status != I40E_SUCCESS)
return status;
Expand Down

0 comments on commit 601bb85

Please sign in to comment.