From: Kalesh AP Date: Wed, 10 Mar 2021 07:50:53 +0000 (+0530) Subject: net/bnxt: fix HWRM and FW incompatibility handling X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b0764e7c207b0932ecd73655d8f7aa015e6733f4;p=dpdk.git net/bnxt: fix HWRM and FW incompatibility handling Fix to return an error when the HWRM version that the driver is compiled against is incompatible with the FW that is actually running on the card. This is determined based on the req length indicated by FW against the value supported in the HWRM. Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index c16edc8956..3de5c7e3a1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1271,6 +1271,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout) if (bp->max_req_len > resp->max_req_win_len) { PMD_DRV_LOG(ERR, "Unsupported request length\n"); rc = -EINVAL; + goto error; } bp->chip_num = rte_le_to_cpu_16(resp->chip_num);