From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47775A0567; Wed, 10 Mar 2021 08:28:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D38D22A447; Wed, 10 Mar 2021 08:28:45 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.229.182]) by mails.dpdk.org (Postfix) with ESMTP id 2ED2622A4A9 for ; Wed, 10 Mar 2021 08:28:43 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 4766D80E2; Tue, 9 Mar 2021 23:28:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4766D80E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1615361322; bh=DyVri3HzSR2HY5ZBVHiaIV2RK5nQZay5o5lzJXW250s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGeJ7DRjOpvc0HxZE90d1LNIBUvuX3RS4Pg5tBGKaZd+G71kOzmAtP/vYXPCs3m32 rWzRjMrYOncWgqmjb1CDlsytkHsSZZhFWyqDiK7SpGLVRGbg7Gn4Evfw7slM1n5BYI Tfxhot/1ZLNjmtitU9G2L2KpbFzZvvXb6VfmuOM8= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 10 Mar 2021 13:20:53 +0530 Message-Id: <20210310075054.24377-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20210310075054.24377-1-kalesh-anakkur.purayil@broadcom.com> References: <20210310075054.24377-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 1/2] net/bnxt: fix HWRM and FW incompatibility handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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 Kumar 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 0b5318e..582f4d1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1143,6 +1143,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.10.1