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 42A53A034C; Wed, 27 Apr 2022 17:00:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 228FC42843; Wed, 27 Apr 2022 16:58:54 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 20FD44283B for ; Wed, 27 Apr 2022 16:58:51 +0200 (CEST) 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 7AFCEC0000F2; Wed, 27 Apr 2022 07:58:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 7AFCEC0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1651071530; bh=hd3yjZ462twDgj5Kd6QFX/gG/tX0fugKjtgztja+EVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3Y1xUzIulxW3Cry4ln5beBoRjeJHB86MuQ/PeZPo4cxrvQLSjuEkoUdxDoIgXLkW V2bu3wMMWNS6gg22apTe1DiJTVPH9hLfEXXmrpchzqa6svvnOGqIUfspl13Df38Zy5 D3ZVwWQLh9x7omPUMG9yDmmAWnlAqiGj3AMxkgUA= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Subject: [PATCH 15/17] net/bnxt: recheck FW readiness if FW is in reset process Date: Wed, 27 Apr 2022 20:28:19 +0530 Message-Id: <20220427145821.5987-16-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> References: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> 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 From: Kalesh AP If Firmware is still in reset process and returns the error HWRM_ERR_CODE_HOT_RESET_PROGRESS, retry VER_GET command. We have to do it in bnxt_handle_if_change_status(). Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 69f1117..abcb534 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -177,6 +177,7 @@ static int bnxt_restore_vlan_filters(struct bnxt *bp); static void bnxt_dev_recover(void *arg); static void bnxt_free_error_recovery_info(struct bnxt *bp); static void bnxt_free_rep_info(struct bnxt *bp); +static int bnxt_check_fw_ready(struct bnxt *bp); int is_bnxt_in_error(struct bnxt *bp) { @@ -1350,6 +1351,11 @@ static int bnxt_handle_if_change_status(struct bnxt *bp) /* clear fatal flag so that re-init happens */ bp->flags &= ~BNXT_FLAG_FATAL_ERROR; + + rc = bnxt_check_fw_ready(bp); + if (rc) + return rc; + rc = bnxt_init_resources(bp, true); bp->flags &= ~BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE; @@ -4324,7 +4330,7 @@ static int bnxt_restore_filters(struct bnxt *bp) static int bnxt_check_fw_ready(struct bnxt *bp) { - int timeout = bp->fw_reset_max_msecs; + int timeout = bp->fw_reset_max_msecs ? : BNXT_MAX_FW_RESET_TIMEOUT; int rc = 0; do { -- 2.10.1