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 38853A034D; Fri, 28 Jan 2022 13:21:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFBBD42896; Fri, 28 Jan 2022 13:21:12 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp10.broadcom.com [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id 0F1ED40141 for ; Fri, 28 Jan 2022 13:21:11 +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 4FCEBC0000D9; Fri, 28 Jan 2022 04:21:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4FCEBC0000D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1643372470; bh=BvT9gpvfUp7iQuFXPjlk2+nRbQ1PBQf9K0dSi0QStH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFqhq04U2wgSQBkQ/sVPHuW5SxYhbZUzIZPmP1tLAv+EUY5IsKDFaGCn7bRX/aA0L 6vJDI/5nX4dPhqUnbdzs8v0LauKx2hqv5ySTPkcnIQY7bXp3j3llRKXJ/aYzX2Ql9M rBaBO2hz/2Wte5tVTo1VBztvfSm5w56YNsTc+/0o= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com, asafp@nvidia.com Subject: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events Date: Fri, 28 Jan 2022 18:18:27 +0530 Message-Id: <20220128124830.427-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220128124830.427-1-kalesh-anakkur.purayil@broadcom.com> References: <20201009034832.10302-1-kalesh-anakkur.purayil@broadcom.com> <20220128124830.427-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 Adding support for the device reset and recovery events in the rte_eth_event framework. FW error and FW reset conditions would be managed internally by the PMD without needing application intervention. In such cases, PMD would need reset/recovery events to notify application that PMD is undergoing a reset. While most of the recovery process is transparent to the application since most of the driver ensures recovery from FW reset or FW error conditions, the application will have to reprogram any flows which were offloaded to the underlying hardware. Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- doc/guides/prog_guide/poll_mode_drv.rst | 24 ++++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 6831289..9ecc0e4 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -623,3 +623,27 @@ by application. The PMD itself should not call rte_eth_dev_reset(). The PMD can trigger the application to handle reset event. It is duty of application to handle all synchronization before it calls rte_eth_dev_reset(). + +Error recovery support +~~~~~~~~~~~~~~~~~~~~~~ + +When the PMD detects a FW reset or error condition, it may try to recover +from the error without needing the application intervention. In such cases, +PMD would need events to notify the application that it is undergoing +an error recovery. + +The PMD should trigger RTE_ETH_EVENT_ERR_RECOVERING event to notify the +application that PMD detected a FW reset or FW error condition. PMD may +try to recover from the error by itself. Data path may be quiesced and +control path operations may fail during the recovery period. The application +should stop polling till it receives RTE_ETH_EVENT_RECOVERED event from the PMD. + +The PMD should trigger RTE_ETH_EVENT_RECOVERED event to notify the application +that the it has recovered from the error condition. PMD re-configures the port +to the state prior to the error condition. Control path and data path are up now. +Since the device has undergone a reset, flow rules offloaded prior to reset +may be lost and the application should recreate the rules again. + +The PMD should trigger RTE_ETH_EVENT_INTR_RMV event to notify the application +that it has failed to recover from the error condition. The device may not be +usable anymore. diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 147cc1c..a46819f 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -3818,6 +3818,24 @@ 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_ERR_RECOVERING, + /**< port recovering from an error + * + * PMD detected a FW reset or error condition. + * PMD will try to recover from the error. + * Data path may be quiesced and Control path operations + * may fail at this time. + */ + RTE_ETH_EVENT_RECOVERED, + /**< port recovered from an error + * + * PMD has recovered from the error condition. + * Control path and Data path are up now. + * PMD re-configures the port to the state prior to the error. + * Since the device has undergone a reset, flow rules + * offloaded prior to reset may be lost and + * the application should recreate the rules again. + */ RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -- 2.10.1