From patchwork Thu Sep 22 07:41:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fengchengwen X-Patchwork-Id: 116634 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BAF0A0543; Thu, 22 Sep 2022 09:48:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A50D40156; Thu, 22 Sep 2022 09:48:09 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 5B5DB40156 for ; Thu, 22 Sep 2022 09:48:07 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MY6jh2wWNzWgvP; Thu, 22 Sep 2022 15:44:08 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 15:48:05 +0800 From: Chengwen Feng To: , , CC: , , , , , Subject: [PATCH v9 5/5] net/bnxt: support proactive error handling mode Date: Thu, 22 Sep 2022 07:41:51 +0000 Message-ID: <20220922074151.39450-6-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220922074151.39450-1-fengchengwen@huawei.com> References: <20220128124831.427-1-kalesh-anakkur.purayil@broadcom.com> <20220922074151.39450-1-fengchengwen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 This patch supports proactive error handling mode. Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde Reviewed-by: Chengwen Feng --- drivers/net/bnxt/bnxt_cpr.c | 4 ++++ drivers/net/bnxt/bnxt_ethdev.c | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 99af0f9e87..5bb376d4d5 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -180,6 +180,10 @@ void bnxt_handle_async_event(struct bnxt *bp, return; } + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_ERR_RECOVERING, + NULL); + pthread_mutex_lock(&bp->err_recovery_lock); event_data = data1; /* timestamp_lo/hi values are in units of 100ms */ diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e275d3a53f..3da0302b1b 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1063,6 +1063,8 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, dev_info->vmdq_pool_base = 0; dev_info->vmdq_queue_base = 0; + dev_info->err_handle_mode = RTE_ETH_ERROR_HANDLE_MODE_PROACTIVE; + return 0; } @@ -4381,13 +4383,18 @@ static void bnxt_dev_recover(void *arg) PMD_DRV_LOG(INFO, "Port: %u Recovered from FW reset\n", bp->eth_dev->data->port_id); pthread_mutex_unlock(&bp->err_recovery_lock); - + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RECOVERY_SUCCESS, + NULL); return; err_start: bnxt_dev_stop(bp->eth_dev); err: bp->flags |= BNXT_FLAG_FATAL_ERROR; bnxt_uninit_resources(bp, false); + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RECOVERY_FAILED, + NULL); if (bp->eth_dev->data->dev_conf.intr_conf.rmv) rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_INTR_RMV, @@ -4559,6 +4566,10 @@ static void bnxt_check_fw_health(void *arg) PMD_DRV_LOG(ERR, "Detected FW dead condition\n"); + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_ERR_RECOVERING, + NULL); + if (bnxt_is_primary_func(bp)) wait_msec = info->primary_func_wait_period; else