From: Kalesh AP <kalesh-anakkur.pura...@broadcom.com> Added code to handle device recovery event in testpmd. This is an indication from PMD that it has recovered from a FW reset or FW error condition.
Signed-off-by: Kalesh AP <kalesh-anakkur.pura...@broadcom.com> Reviewed-by: Ajit Kumar Khaparde <ajit.khapa...@broadcom.com> --- app/test-pmd/testpmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f9f4cd1..d1f063e 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -375,6 +375,7 @@ static const char * const eth_event_desc[] = { [RTE_ETH_EVENT_INTR_RMV] = "device removal", [RTE_ETH_EVENT_NEW] = "device probed", [RTE_ETH_EVENT_DESTROY] = "device released", + [RTE_ETH_EVENT_RECOVERED] = "device recovered", [RTE_ETH_EVENT_MAX] = NULL, }; @@ -388,7 +389,8 @@ uint32_t event_print_mask = (UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN) | (UINT32_C(1) << RTE_ETH_EVENT_INTR_RESET) | (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_INTR_RMV) | + (UINT32_C(1) << RTE_ETH_EVENT_RECOVERED); /* * Decide if all memory are locked for performance. */ @@ -2920,6 +2922,9 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, rmv_port_callback, (void *)(intptr_t)port_id)) fprintf(stderr, "Could not set up deferred device removal\n"); break; + case RTE_ETH_EVENT_RECOVERED: + printf("Please recreate any rules offloaded prior to this\n"); + break; default: break; } -- 2.10.1