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 BF184A034D; Fri, 28 Jan 2022 13:21:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBF714289F; Fri, 28 Jan 2022 13:21:13 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id C223542890 for ; Fri, 28 Jan 2022 13:21:12 +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 1EDC6C0000EC; Fri, 28 Jan 2022 04:21:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 1EDC6C0000EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1643372472; bh=cABqB8X2S2RGDVsg8wc56XfAIbyi35KkguJ99abzivQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YfcwHNVb9e0yssLexGrIeihkvMTskxvpmj1y4+GuFubfJGHWKN4yrzC2LUISt9xsk w445bQmBSflwTeJKvwT5envTI36tG709GIw0ya8/P8o450ecXVfTIrdOFoiXREtcd7 hOHg5HbQb3PBUzlxw8FsKLdf/EK1kURlUqVxUvho= 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 2/4] app/testpmd: handle device recovery event Date: Fri, 28 Jan 2022 18:18:28 +0530 Message-Id: <20220128124830.427-3-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 Added code to handle error recovery events in testpmd. This is an indication from the PMD that it is undergoing an error recovery and recovered from the error condition. Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- app/test-pmd/parameters.c | 8 ++++++-- app/test-pmd/testpmd.c | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index daf6a31..deea29f 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -175,9 +175,9 @@ usage(char* progname) printf(" --no-rmv-interrupt: disable device removal interrupt.\n"); printf(" --bitrate-stats=N: set the logical core N to perform " "bit-rate calculation.\n"); - printf(" --print-event : " + printf(" --print-event : " "enable print of designated event or all of them.\n"); - printf(" --mask-event : " + printf(" --mask-event : " "disable print of designated event or all of them.\n"); printf(" --flow-isolate-all: " "requests flow API isolated mode on all ports at initialization time.\n"); @@ -461,6 +461,10 @@ parse_event_printing_config(const char *optarg, int enable) mask = UINT32_C(1) << RTE_ETH_EVENT_DESTROY; else if (!strcmp(optarg, "flow_aged")) mask = UINT32_C(1) << RTE_ETH_EVENT_FLOW_AGED; + else if (!strcmp(optarg, "err_recovering")) + mask = UINT32_C(1) << RTE_ETH_EVENT_ERR_RECOVERING; + else if (!strcmp(optarg, "recovered")) + mask = UINT32_C(1) << RTE_ETH_EVENT_RECOVERED; else if (!strcmp(optarg, "all")) mask = ~UINT32_C(0); else { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e1da961..7b64751 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -417,6 +417,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_ERR_RECOVERING] = "device error, recovery in progress", + [RTE_ETH_EVENT_RECOVERED] = "device recovered", [RTE_ETH_EVENT_MAX] = NULL, }; @@ -431,7 +433,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_ERR_RECOVERING) | + (UINT32_C(1) << RTE_ETH_EVENT_RECOVERED); /* * Decide if all memory are locked for performance. */ @@ -3564,6 +3568,10 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, ports[port_id].port_status = RTE_PORT_CLOSED; printf("Port %u is closed\n", port_id); break; + case RTE_ETH_EVENT_RECOVERED: + /* for now, flush flows to avoid displaying stale entries */ + port_flow_flush(port_id); + break; default: break; } -- 2.10.1