From patchwork Wed Sep 30 07:12:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 79299 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C16EA04B1; Wed, 30 Sep 2020 08:58:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5E721DB28; Wed, 30 Sep 2020 08:58:27 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.232.172]) by dpdk.org (Postfix) with ESMTP id A94371DB16 for ; Wed, 30 Sep 2020 08:58:24 +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 F28C842229; Tue, 29 Sep 2020 23:58:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com F28C842229 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1601449103; bh=p9phL807diaw7tLKK2WIlqm6/Uml4Ql02lpbHON85yY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxjVWIYSOBO1R6ichTLfdiosYjNl0ncMwnfxqc/AfQZua3sFjtORlUwYTzqljNWmq boN+QhXD+LY6D9bCp4nXlTEqd8VZxaPG0ga52aUUy7NLeuv5QN8j+nUgodyxnL7WgX 7+KOaRcS3OSKX3rVeL56cj+V3fJlnG6R4KNZ+Mgo= From: Kalesh A P To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 30 Sep 2020 12:42:56 +0530 Message-Id: <20200930071258.22457-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> References: <20200122101654.20824-1-kalesh-anakkur.purayil@broadcom.com> <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [RFC PATCH v3 1/3] ethdev: support device reset and recovery events X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Adding support for device reset and recovery events in the rte_eth_event framework. FW error and FW reset conditions would be managed internally by PMD without needing application intervention. In such cases, PMD would need reset/recovery events to notify application that PMD is undergoing a reset. Signed-off-by: Somnath Kotur Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde --- lib/librte_ethdev/rte_ethdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 9759f13..b9dd14c 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -3207,6 +3207,8 @@ enum rte_eth_event_type { RTE_ETH_EVENT_DESTROY, /**< port is released */ RTE_ETH_EVENT_IPSEC, /**< IPsec offload related event */ RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */ + RTE_ETH_EVENT_RESET, /**< port resetting from an error */ + RTE_ETH_EVENT_RECOVERED, /**< port recovered from an error */ RTE_ETH_EVENT_MAX /**< max value of this enum */ }; From patchwork Wed Sep 30 07:12:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 79300 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50FBEA04B1; Wed, 30 Sep 2020 08:58:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B0CB1DB48; Wed, 30 Sep 2020 08:58:29 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.232.172]) by dpdk.org (Postfix) with ESMTP id 771511DB16 for ; Wed, 30 Sep 2020 08:58:26 +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 BC823829C; Tue, 29 Sep 2020 23:58:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com BC823829C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1601449105; bh=ygImelzxlTI8OljNQLYZbWVXfFMm72JtFz0cPuSXz28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQdAu2/0HfTkHQjO9TaAlQ1ZFJB+EmA6ac/D9t3WeY78ea0kn4kXf9JUSyhj5f0lL 4birq5GcpOhexjRx48qKVtUUU+9DmxiURDENaxoyD+7ldS5vREH+jGtW31i8gW8bPg VKp8MlfgieVDnAQbZ8yzXlFaPtNSR//6Kp3bxMhQ= From: Kalesh A P To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 30 Sep 2020 12:42:57 +0530 Message-Id: <20200930071258.22457-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> References: <20200122101654.20824-1-kalesh-anakkur.purayil@broadcom.com> <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [RFC PATCH v3 2/3] net/bnxt: notify applications about device reset/recovery X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 When the driver receives RESET_NOTIFY async event from FW or detected an error condition, it should update the application that FW is going to reset. Once the driver recoveres from the reset, update the reset recovery status to application as well. The recovery process is transparent to the application as the driver itself tries to recover from FW reset or FW error conditions. Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_cpr.c | 3 +++ drivers/net/bnxt/bnxt_ethdev.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 8311e26..f2fddf7 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -129,6 +129,9 @@ void bnxt_handle_async_event(struct bnxt *bp, bp->flags |= BNXT_FLAG_FATAL_ERROR; return; } + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RESET, + NULL); event_data = rte_le_to_cpu_32(async_cmp->event_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 b99c712..609bf46 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4566,6 +4566,9 @@ static void bnxt_dev_recover(void *arg) goto err_start; PMD_DRV_LOG(INFO, "Recovered from FW reset\n"); + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RECOVERED, + NULL); return; err_start: bnxt_dev_stop_op(bp->eth_dev); @@ -4573,6 +4576,9 @@ static void bnxt_dev_recover(void *arg) bp->flags |= BNXT_FLAG_FATAL_ERROR; bnxt_uninit_resources(bp, false); PMD_DRV_LOG(ERR, "Failed to recover from FW reset\n"); + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_INTR_RMV, + NULL); } void bnxt_dev_reset_and_resume(void *arg) @@ -4708,6 +4714,9 @@ static void bnxt_check_fw_health(void *arg) bp->flags |= BNXT_FLAG_FW_RESET; PMD_DRV_LOG(ERR, "Detected FW dead condition\n"); + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RESET, + NULL); if (bnxt_is_master_func(bp)) wait_msec = info->master_func_wait_period; From patchwork Wed Sep 30 07:12:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 79301 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C70F8A04B1; Wed, 30 Sep 2020 08:59:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A59CC1DB54; Wed, 30 Sep 2020 08:58:34 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.232.172]) by dpdk.org (Postfix) with ESMTP id 297111DB3C for ; Wed, 30 Sep 2020 08:58:28 +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 798877FCD; Tue, 29 Sep 2020 23:58:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 798877FCD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1601449106; bh=HYRSapPeowuqMbN1JcORqch1InL3yrDW94rX2G561yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e5UoEQEtgAwvvd3yjKcsCycURQjp7mWYp/4+7Ylf7eHou/uHGAYKMdY+IywHQ1UFe 4mkelE1OBNMfr6ud7ywhp/OZvPzr23rWMgzRu5lb9Ezok46dYFhTY6VAjEdFdU+s4w Q0Apwo5F/EJ3wjKlIbe0aUxS5ekca1RsEesHCUvU= From: Kalesh A P To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 30 Sep 2020 12:42:58 +0530 Message-Id: <20200930071258.22457-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> References: <20200122101654.20824-1-kalesh-anakkur.purayil@broadcom.com> <20200930071258.22457-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [RFC PATCH v3 3/3] app/testpmd: handle device recovery event X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Added code to handle device reset and recovery event in testpmd. This is an indication from the PMD that device has reset and recovered error condition. Signed-off-by: Kalesh AP Reviewed-by: Ajit Kumar Khaparde --- app/test-pmd/testpmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index fe6450c..1c8fb46 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -380,6 +380,8 @@ static const char * const eth_event_desc[] = { [RTE_ETH_EVENT_NEW] = "device probed", [RTE_ETH_EVENT_DESTROY] = "device released", [RTE_ETH_EVENT_FLOW_AGED] = "flow aged", + [RTE_ETH_EVENT_RESET] = "device reset", + [RTE_ETH_EVENT_RECOVERED] = "device recovery", [RTE_ETH_EVENT_MAX] = NULL, }; @@ -394,7 +396,9 @@ uint32_t event_print_mask = (UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN) | (UINT32_C(1) << RTE_ETH_EVENT_IPSEC) | (UINT32_C(1) << RTE_ETH_EVENT_MACSEC) | (UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV) | - (UINT32_C(1) << RTE_ETH_EVENT_FLOW_AGED); + (UINT32_C(1) << RTE_ETH_EVENT_FLOW_AGED) | + (UINT32_C(1) << RTE_ETH_EVENT_RESET) | + (UINT32_C(1) << RTE_ETH_EVENT_RECOVERED); /* * Decide if all memory are locked for performance. */