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 9182CA034D; Fri, 28 Jan 2022 13:21:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FDE3428BC; Fri, 28 Jan 2022 13:21:16 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp10.broadcom.com [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id 8D029428A6 for ; Fri, 28 Jan 2022 13:21:14 +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 E22E9C0000EA; Fri, 28 Jan 2022 04:21:12 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com E22E9C0000EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1643372474; bh=EIrM3VBGU9W9CnHvP4GFXpsrZJKjR6q3GRf9+F0djnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZIIs/Icwnj9r+yEhAFiJ1UN9Bgz6Efu0jTkUGhMKAYFC/z29V7VKzqKPn+zyqyJxS O+5tbjSgk23CEdU1O/k5aE+MnBvO9r0JaVuz5ZkK9tJ0CCYMXT8NTHRTIn5IFAeAR5 NZn4/c24408SnW9W4c89SrSyDitFc1j6auY66HDg= 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 3/4] net/bnxt: notify applications about device reset/recovery Date: Fri, 28 Jan 2022 18:18:29 +0530 Message-Id: <20220128124830.427-4-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 When the driver receives RESET_NOTIFY async event from FW or detects an error condition, it should update the application that FW is going to reset. Once the driver recovers from the reset, update the reset recovery status to application as well. Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_cpr.c | 4 ++++ drivers/net/bnxt/bnxt_ethdev.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 9b9285b..738eac7 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -180,6 +180,10 @@ void bnxt_handle_async_event(struct bnxt *bp, return; } + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_ERR_RECOVERING, + NULL); + pthread_mutex_lock(&bp->err_recovery_lock); event_data = 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 cc95211..579e571 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4383,7 +4383,9 @@ static void bnxt_dev_recover(void *arg) PMD_DRV_LOG(INFO, "Port: %u Recovered from FW reset\n", bp->eth_dev->data->port_id); pthread_mutex_unlock(&bp->err_recovery_lock); - + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_RECOVERED, + NULL); return; err_start: bnxt_dev_stop(bp->eth_dev); @@ -4561,6 +4563,10 @@ static void bnxt_check_fw_health(void *arg) PMD_DRV_LOG(ERR, "Detected FW dead condition\n"); + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_ERR_RECOVERING, + NULL); + if (bnxt_is_primary_func(bp)) wait_msec = info->primary_func_wait_period; else -- 2.10.1