[RFC,v3,3/3] app/testpmd: handle device recovery event

Message ID 20200930071258.22457-4-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series librte_ethdev: error recovery support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Kalesh A P Sept. 30, 2020, 7:12 a.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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 <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 app/test-pmd/testpmd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Asaf Penso Oct. 8, 2020, 10:53 a.m. UTC | #1
>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Kalesh A P
>Sent: Wednesday, September 30, 2020 10:13 AM
>To: dev@dpdk.org
>Cc: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
>ferruh.yigit@intel.com; ajit.khaparde@broadcom.com
>Subject: [dpdk-dev] [RFC PATCH v3 3/3] app/testpmd: handle device recovery
>event
>
>From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
>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 <kalesh-anakkur.purayil@broadcom.com>
>Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
>---
> 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.
>  */
>--
>2.10.1

I think you would need also to update parse_event_printing_config function in parameters.c file.
Do you think the release_notes_20.11.rst should be updated with these new events?
  

Patch

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.
  */