net/bnxt: fix HWRM and FW incompatibility handling
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 10 Mar 2021 07:50:53 +0000 (13:20 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 12 Mar 2021 06:13:28 +0000 (07:13 +0100)
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 <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index c16edc8..3de5c7e 100644 (file)
@@ -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);