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 BCF53A0A0E for ; Mon, 10 May 2021 18:08:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B398540395; Mon, 10 May 2021 18:08:34 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060.outbound.protection.outlook.com [40.107.243.60]) by mails.dpdk.org (Postfix) with ESMTP id 91B6C40395 for ; Mon, 10 May 2021 18:08:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XXqS+vRwYksOEuOGKCmSG29MduMcJxIRe3UboVOPAnm1EKxWPDvA2dvkw07BFfxpT6kE7D7N6JRluJCuteLwlLzj20QmYvDb6d+GD6c1WliIM4Ax+fO5vzM4kOq5un6+uYnAKrAWzrUOh6XuCtXr3X0NwVnip0rV01WJ7NHQFIljEduebNuZWz3Z2MqTUmkmwY79ClTLqJT6bowE0mvXe4H0P9dqaUeei1tr2XGgrVfsz8tEBd1UjfV0WwfInmYSNmGnF+SJKs1wF0HeXpP43vPLfQhxpvV9M1Y1P8SFjxncfr7r0Ly2dmxToBbxZBFfSwfFlQQpZ8U3UOdmGKF+wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DLZ6lEJPp1CmAVjr5QKbX9qnxdi9JAyD4QKzShVKy0E=; b=dD3zOxSU+tOzLfAXaerRHiShL3wu4DPKo0DtR6VHoLTMPsTQ7rtjw99kVk7AAg8mfVheru8vmudqBRLw1Gl4pi8nEDybxuHFNM3S00uIPd1p4fgznJe8X0N3ClmrUlOt6R5puKxaBMFhgNOaA45RY6IE8+TQPbLQ4qq3XEJQrKEK7kMd7xkl4W8RQlh7iANQNfRys98okOs6pD+VBhKLscI/ujr3Bz8QhknHHhfXV7c78aZov281otI2PREf6ATlmbaaM1cow6Qxm6dpaxcOq58lks2EmlwfDgzWMmqn3MeCjEbUHxu9NCsaT5vUaZiGyF33jD2c3pHO/dDY9P/H7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=broadcom.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DLZ6lEJPp1CmAVjr5QKbX9qnxdi9JAyD4QKzShVKy0E=; b=Als7TBu7mK3c+IK8Vz8+yLYq3lWx+RafPn6Sl2ZlfJESWutpAwxdwyBQ3xXxoCkC1MJos3O2LoLDM6mC+2/j9N6q+sy5tskm52taj2hJWvXSRUBxDat+7mBrrMY5av4Ei1oU/Q02MpjtXQRmm6m+goXBX31HMWyqRiM5R35/3U70R3na4iL+Tt3CkW8KLcdk/Hup+lq7JYehxkWizKwxP4NJk6KKPddQaC/2RSpj61g52x4v6wj1AvOxDVOdAnIMK0Vx7vhEXKEo0HZKT6T0AbJBYphBRmJeaYLU+y2esQ3368N8nQhAUYN25J1Il16SOSCoj4kj91si9At/ccM1hA== Received: from BN0PR03CA0012.namprd03.prod.outlook.com (2603:10b6:408:e6::17) by BN6PR12MB1555.namprd12.prod.outlook.com (2603:10b6:405:5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.31; Mon, 10 May 2021 16:08:32 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::8a) by BN0PR03CA0012.outlook.office365.com (2603:10b6:408:e6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:08:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; broadcom.com; dkim=none (message not signed) header.d=none;broadcom.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:08:31 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:08:26 +0000 From: Xueming Li To: Kalesh AP CC: Luca Boccassi , Ajit Khaparde , Somnath Kotur , dpdk stable Date: Tue, 11 May 2021 00:00:03 +0800 Message-ID: <20210510160258.30982-54-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc34a4c6-a60c-4a7b-1b4d-08d913cddb6c X-MS-TrafficTypeDiagnostic: BN6PR12MB1555: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WnW/6a5JzNCd1RpB0DuVxalr/7eH7cSO3a/gwB2cwoJOGY7GRT9AcRiMUlXhLAuAOk4UqdvmtRx9i2RS7Jf3Ijq3i+eD+RcIRSvecCnkSt8lB+At7u8KAczbTFQHXqOIvl4iGghwGCia0VaylyOejE6pbB0txfUrEDNaxG5RLXCv+uEWxGvnNV8U1q6lEjlmm4/Y7Ag/+OTUSTUb2PSAq6fZOeS64bqTlzQ9r3vwe9As/X2f+XnS+K2fcUlAcMXIV4vXciUn/P3VQJJPeMM8bOU/YivwdnDVEM8HQ7IPa5W2CrhThXFIupz7FCVUjNnFY4Op/eeM1ukqM3X7V9SbQnCK4IVsq/lBWHkEvNpIHKPij7cbCAW3yGx8qxT3k2iLUA+/Dr4gJ++UAbNC3gUAnp+M0G++VVOLhzI79kTzhq+aIBbsWnLXLOl+Fj3dnYYhj9x7p10D8xeUFq5NRkzYHnfkzrtL/gJKQO4dfbcUEooUPzMGnkxkh1mBPGZxqu+Lianye8/lnyM9Ub+4aSHIz+l44xzPpRM+XI9OxDR4lR78c6i3bbOL93epdsngYWVRy2/XU86nqzvHPAcaQyZZZsC5WQB+F7Im4vXmrp8p0f24+DQRoqWgGxDWhlonFcsvVcNJgCytRUYL7ZsIUU6rCuNkhsqGPz2sQYku77cnHrmXDZVI/XnrH6simY4aOf0SP12FtQevPh0MTVz+v8rYN0j6F/zG3USUEsJC4UX/IDA/wRDUUiRfFC21M8MsJ/P8u7uT+cwnPyUXXcrWET5ZEg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(396003)(136003)(46966006)(36840700001)(8936002)(356005)(26005)(53546011)(7696005)(6286002)(47076005)(8676002)(82310400003)(70586007)(7636003)(4326008)(55016002)(966005)(36860700001)(5660300002)(36906005)(70206006)(86362001)(83380400001)(36756003)(6916009)(1076003)(54906003)(316002)(2616005)(2906002)(336012)(16526019)(426003)(186003)(82740400003)(478600001)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:08:31.8355 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc34a4c6-a60c-4a7b-1b4d-08d913cddb6c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1555 Subject: [dpdk-stable] patch 'net/bnxt: fix FW readiness check during recovery' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/2d5c16160536ea53e820a758a71b6e3150d97f45 Thanks. Xueming Li --- >From 2d5c16160536ea53e820a758a71b6e3150d97f45 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 24 Feb 2021 21:25:52 +0530 Subject: [PATCH] net/bnxt: fix FW readiness check during recovery Cc: Luca Boccassi [ upstream commit 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 ] Moved fw readiness check to a new routine bnxt_check_fw_ready(). During error recovery, driver needs to wait for fw readiness. For that, it uses bnxt_hwrm_ver_get() function now and that function does parsing of the VER_GET response as well. Added a new lightweight function bnxt_hwrm_poll_ver_get() for polling the firmware readiness which issues VER_GET and checks for success without processing the command response. Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 33 +++++++++++++++++++++------------ drivers/net/bnxt/bnxt_hwrm.c | 23 +++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f0de861798..f247603edb 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3798,10 +3798,28 @@ static int bnxt_restore_filters(struct bnxt *bp) return ret; } +static int bnxt_check_fw_ready(struct bnxt *bp) +{ + int timeout = bp->fw_reset_max_msecs; + int rc = 0; + + do { + rc = bnxt_hwrm_poll_ver_get(bp); + if (rc == 0) + break; + rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL); + timeout -= BNXT_FW_READY_WAIT_INTERVAL; + } while (rc && timeout > 0); + + if (rc) + PMD_DRV_LOG(ERR, "FW is not Ready after reset\n"); + + return rc; +} + static void bnxt_dev_recover(void *arg) { struct bnxt *bp = arg; - int timeout = bp->fw_reset_max_msecs; int rc = 0; @@ -3814,18 +3832,9 @@ static void bnxt_dev_recover(void *arg) /* Clear Error flag so that device re-init should happen */ bp->flags &= ~BNXT_FLAG_FATAL_ERROR; - do { - rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT); - if (rc == 0) - break; - rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL); - timeout -= BNXT_FW_READY_WAIT_INTERVAL; - } while (rc && timeout); - - if (rc) { - PMD_DRV_LOG(ERR, "FW is not Ready after reset\n"); + rc = bnxt_check_fw_ready(bp); + if (rc) goto err; - } rc = bnxt_init_resources(bp, true); if (rc) { diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 3dce024744..2477237b39 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -5811,3 +5811,26 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep_bp) rep_bp->vf_id); return rc; } + + +int bnxt_hwrm_poll_ver_get(struct bnxt *bp) +{ + struct hwrm_ver_get_input req = {.req_type = 0 }; + struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr; + int rc = 0; + + bp->max_req_len = HWRM_MAX_REQ_LEN; + bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT; + + HWRM_PREP(&req, HWRM_VER_GET, BNXT_USE_CHIMP_MB); + req.hwrm_intf_maj = HWRM_VERSION_MAJOR; + req.hwrm_intf_min = HWRM_VERSION_MINOR; + req.hwrm_intf_upd = HWRM_VERSION_UPDATE; + + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT_SILENT(); + HWRM_UNLOCK(); + + return rc; +} \ No newline at end of file diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index c2bcb7dd63..11b3b1cea1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -301,4 +301,5 @@ int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid, uint16_t *first_vf_id); int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep); int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep); +int bnxt_hwrm_poll_ver_get(struct bnxt *bp); #endif -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.060118000 +0800 +++ 0055-net-bnxt-fix-FW-readiness-check-during-recovery.patch 2021-05-10 23:59:26.400000000 +0800 @@ -1 +1 @@ -From 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 Mon Sep 17 00:00:00 2001 +From 2d5c16160536ea53e820a758a71b6e3150d97f45 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ - drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++++++++++++ + drivers/net/bnxt/bnxt_hwrm.c | 23 +++++++++++++++++++++++ @@ -26 +28 @@ - 3 files changed, 44 insertions(+), 12 deletions(-) + 3 files changed, 45 insertions(+), 12 deletions(-) @@ -29 +31 @@ -index 67ff800da5..af146451a5 100644 +index f0de861798..f247603edb 100644 @@ -32 +34 @@ -@@ -3859,10 +3859,28 @@ static int bnxt_restore_filters(struct bnxt *bp) +@@ -3798,10 +3798,28 @@ static int bnxt_restore_filters(struct bnxt *bp) @@ -61,2 +63,2 @@ - pthread_mutex_lock(&bp->err_recovery_lock); -@@ -3876,18 +3894,9 @@ static void bnxt_dev_recover(void *arg) + +@@ -3814,18 +3832,9 @@ static void bnxt_dev_recover(void *arg) @@ -84 +86 @@ -index 9142119954..0b5318e238 100644 +index 3dce024744..2477237b39 100644 @@ -87,2 +89,2 @@ -@@ -5913,3 +5913,25 @@ int bnxt_hwrm_fw_echo_reply(struct bnxt *bp, uint32_t echo_req_data1, - +@@ -5811,3 +5811,26 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep_bp) + rep_bp->vf_id); @@ -91,0 +94 @@ ++ @@ -112,0 +116 @@ +\ No newline at end of file @@ -114 +118 @@ -index c47c2498e9..785e321bfd 100644 +index c2bcb7dd63..11b3b1cea1 100644 @@ -117,4 +121,4 @@ -@@ -304,4 +304,5 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep); - int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp); - int bnxt_hwrm_fw_echo_reply(struct bnxt *bp, uint32_t echo_req_data1, - uint32_t echo_req_data2); +@@ -301,4 +301,5 @@ int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid, + uint16_t *first_vf_id); + int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep); + int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep);