return ret;
}
+static int bnxt_check_fw_ready(struct bnxt *bp)
+{
+ int timeout = bp->fw_reset_max_msecs;
+ int rc = 0;
+
+ do {
+ rc = bnxt_hwrm_poll_ver_get(bp);
+ if (rc == 0)
+ break;
+ rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
+ timeout -= BNXT_FW_READY_WAIT_INTERVAL;
+ } while (rc && timeout > 0);
+
+ if (rc)
+ PMD_DRV_LOG(ERR, "FW is not Ready after reset\n");
+
+ return rc;
+}
+
static void bnxt_dev_recover(void *arg)
{
struct bnxt *bp = arg;
- int timeout = bp->fw_reset_max_msecs;
int rc = 0;
pthread_mutex_lock(&bp->err_recovery_lock);
/* Clear Error flag so that device re-init should happen */
bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
- do {
- rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT);
- if (rc == 0)
- break;
- rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
- timeout -= BNXT_FW_READY_WAIT_INTERVAL;
- } while (rc && timeout);
-
- if (rc) {
- PMD_DRV_LOG(ERR, "FW is not Ready after reset\n");
+ rc = bnxt_check_fw_ready(bp);
+ if (rc)
goto err;
- }
rc = bnxt_init_resources(bp, true);
if (rc) {
return rc;
}
+
+int bnxt_hwrm_poll_ver_get(struct bnxt *bp)
+{
+ struct hwrm_ver_get_input req = {.req_type = 0 };
+ struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
+ int rc = 0;
+
+ bp->max_req_len = HWRM_MAX_REQ_LEN;
+ bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT;
+
+ HWRM_PREP(&req, HWRM_VER_GET, BNXT_USE_CHIMP_MB);
+ req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
+ req.hwrm_intf_min = HWRM_VERSION_MINOR;
+ req.hwrm_intf_upd = HWRM_VERSION_UPDATE;
+
+ rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+ HWRM_CHECK_RESULT_SILENT();
+ HWRM_UNLOCK();
+
+ return rc;
+}
int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp);
int bnxt_hwrm_fw_echo_reply(struct bnxt *bp, uint32_t echo_req_data1,
uint32_t echo_req_data2);
+int bnxt_hwrm_poll_ver_get(struct bnxt *bp);
#endif