uint16_t max_resp_len;
uint16_t hwrm_max_ext_req_len;
- /* default command timeout value of 50ms */
-#define HWRM_CMD_TIMEOUT 50000
+ /* default command timeout value of 500ms */
+#define DFLT_HWRM_CMD_TIMEOUT 500000
+ /* short command timeout value of 50ms */
+#define SHORT_HWRM_CMD_TIMEOUT 50000
/* default HWRM request timeout value */
uint32_t hwrm_cmd_timeout;
bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
do {
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT);
if (rc == 0)
break;
rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
bp->fw_cap = 0;
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, DFLT_HWRM_CMD_TIMEOUT);
if (rc)
return rc;
if (bp->flags & BNXT_FLAG_FATAL_ERROR)
return 0;
- /* For VER_GET command, set timeout as 50ms */
- if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)
- timeout = HWRM_CMD_TIMEOUT;
- else
- timeout = bp->hwrm_cmd_timeout;
+ timeout = bp->hwrm_cmd_timeout;
if (bp->flags & BNXT_FLAG_SHORT_CMD ||
msg_len > bp->max_req_len) {
return rc;
}
-int bnxt_hwrm_ver_get(struct bnxt *bp)
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
{
int rc = 0;
struct hwrm_ver_get_input req = {.req_type = 0 };
uint32_t dev_caps_cfg;
bp->max_req_len = HWRM_MAX_REQ_LEN;
+ bp->hwrm_cmd_timeout = timeout;
HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB);
req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
/* convert timeout to usec */
bp->hwrm_cmd_timeout *= 1000;
if (!bp->hwrm_cmd_timeout)
- bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT;
+ bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) {
PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx,
struct rte_eth_stats *stats, uint8_t rx);
-int bnxt_hwrm_ver_get(struct bnxt *bp);
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout);
int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);