From b0764e7c207b0932ecd73655d8f7aa015e6733f4 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 10 Mar 2021 13:20:53 +0530 Subject: [PATCH] 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 --- drivers/net/bnxt/bnxt_hwrm.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.20.1