i40e: Add returning AQ critical error to SW
authorMichal Kosiarz <michal.kosiarz@intel.com>
Wed, 27 Dec 2017 13:14:40 +0000 (08:14 -0500)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 26 Jan 2018 21:22:56 +0000 (13:22 -0800)
The FW has the ability to return a critical error on every AQ command.
When this critical error occurs then we need to send the correct response
to the caller.

Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_status.h
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40e_common.c
drivers/net/ethernet/intel/i40evf/i40e_status.h

index d9670cd8743f58170274d56072c52ca77a1405d4..c4fa06dd0a2e4d1cc3c23fd7e6dc5b6e5f7068cd 100644 (file)
@@ -907,10 +907,15 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
        /* update the error if time out occurred */
        if ((!cmd_completed) &&
            (!details->async && !details->postpone)) {
-               i40e_debug(hw,
-                          I40E_DEBUG_AQ_MESSAGE,
-                          "AQTX: Writeback timeout.\n");
-               status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               if (rd32(hw, hw->aq.asq.len) & I40E_GL_ATQLEN_ATQCRIT_MASK) {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: AQ Critical error.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR;
+               } else {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: Writeback timeout.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               }
        }
 
 asq_send_command_error:
index ee6052ecd2158e19dbc62eaa0150e816e725a0b7..c690e9c64c4860a4207c5001419f65bd28c0931f 100644 (file)
@@ -278,6 +278,8 @@ const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err)
                return "I40E_NOT_SUPPORTED";
        case I40E_ERR_FIRMWARE_API_VERSION:
                return "I40E_ERR_FIRMWARE_API_VERSION";
+       case I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
+               return "I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR";
        }
 
        snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
index 5f9cac55aa55cf44737fea614a13e0f2e464bb42..afb72e711d43b865ef4490174d48b52236da9f8e 100644 (file)
@@ -95,6 +95,7 @@ enum i40e_status_code {
        I40E_ERR_NOT_READY                      = -63,
        I40E_NOT_SUPPORTED                      = -64,
        I40E_ERR_FIRMWARE_API_VERSION           = -65,
+       I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR     = -66,
 };
 
 #endif /* _I40E_STATUS_H_ */
index 8b0d4b255dea3b9f833aeff53091b00a9620f084..ae3a7406742573d85db27142475e4a637efa8408 100644 (file)
@@ -837,10 +837,15 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
        /* update the error if time out occurred */
        if ((!cmd_completed) &&
            (!details->async && !details->postpone)) {
-               i40e_debug(hw,
-                          I40E_DEBUG_AQ_MESSAGE,
-                          "AQTX: Writeback timeout.\n");
-               status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               if (rd32(hw, hw->aq.asq.len) & I40E_VF_ATQLEN1_ATQCRIT_MASK) {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: AQ Critical error.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR;
+               } else {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: Writeback timeout.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               }
        }
 
 asq_send_command_error:
index a94648429a5bde468bc1e3b9abc812a0f0d18aa9..67bf5cebb76f06f93fa452641057c8f756c25f9d 100644 (file)
@@ -284,6 +284,8 @@ const char *i40evf_stat_str(struct i40e_hw *hw, i40e_status stat_err)
                return "I40E_NOT_SUPPORTED";
        case I40E_ERR_FIRMWARE_API_VERSION:
                return "I40E_ERR_FIRMWARE_API_VERSION";
+       case I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
+               return "I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR";
        }
 
        snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
index 7fa7a41915c1acce92ce1b8d46cc22d7043f96c2..5b222246e08b3ac6b2669ae0df84c3f3eb36af51 100644 (file)
@@ -95,6 +95,7 @@ enum i40e_status_code {
        I40E_ERR_NOT_READY                      = -63,
        I40E_NOT_SUPPORTED                      = -64,
        I40E_ERR_FIRMWARE_API_VERSION           = -65,
+       I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR     = -66,
 };
 
 #endif /* _I40E_STATUS_H_ */