From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC873A046B for ; Thu, 22 Aug 2019 07:55:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 438491BF6E; Thu, 22 Aug 2019 07:54:33 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id C045A1BF34 for ; Thu, 22 Aug 2019 07:54:09 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id CFB3F30C20F; Wed, 21 Aug 2019 22:54:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com CFB3F30C20F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1566453245; bh=dsERwK1FEFe4jy08G2CmXE/k3AusXZ/rh+CYb2RvkDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vCclEll7TJhsOzhRC+pW68smls/C5Nxjx0rWUQodStTckdLZ9zwrAyldMWL3JKvo4 IATw23aWwdQM9yXMZcRjdshUH8VEKQs2ttZ5AXfe9jkHvV7FRsnPaF1ya7JXuprYfl Yh9X5ZzuD3570n/K5CFGJBXJ/V3rlI71ytEfOtPY= Received: from localhost.localdomain (unknown [10.230.30.225]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 6B0EDAC06AD; Wed, 21 Aug 2019 22:54:05 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , Santoshkumar Karanappa Rastapur Date: Wed, 21 Aug 2019 22:53:58 -0700 Message-Id: <20190822055400.30119-12-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190822055400.30119-1-ajit.khaparde@broadcom.com> References: <20190822055400.30119-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 11/13] net/bnxt: reschedule the health check alarm correctly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP When the driver receives the error recovery notify event from fw for the first time, it has to read the heartbeat count register and recovery count register and schedule the fw health check task for periodically monitoring the fw health. FW may send this event at a later time when the state of master function changes. There is no need to schedule the health check task this time. Signed-off-by: Kalesh AP Reviewed-by: Santoshkumar Karanappa Rastapur Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_cpr.c | 3 +++ drivers/net/bnxt/bnxt_ethdev.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 93aac15b4..edaef7897 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -422,6 +422,7 @@ struct bnxt { #define BNXT_FLAG_EXT_STATS_SUPPORTED BIT(19) #define BNXT_FLAG_NEW_RM BIT(20) #define BNXT_FLAG_INIT_DONE BIT(21) +#define BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED BIT(22) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) #define BNXT_NPAR(bp) ((bp)->port_partition_type) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index a692fbe7c..50f93bd21 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -89,6 +89,9 @@ void bnxt_handle_async_event(struct bnxt *bp, bnxt_is_recovery_enabled(bp), bnxt_is_master_func(bp)); + if (bp->flags & BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED) + return; + info->last_heart_beat = bnxt_read_fw_status_reg(bp, BNXT_FW_HEARTBEAT_CNT_REG); info->last_reset_counter = diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 0317eb888..e7b0b44c4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3687,6 +3687,7 @@ void bnxt_schedule_fw_health_check(struct bnxt *bp) rte_eal_alarm_set(US_PER_MS * polling_freq, bnxt_check_fw_health, (void *)bp); + bp->flags |= BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED; } static void bnxt_cancel_fw_health_check(struct bnxt *bp) @@ -3695,6 +3696,7 @@ static void bnxt_cancel_fw_health_check(struct bnxt *bp) return; rte_eal_alarm_cancel(bnxt_check_fw_health, (void *)bp); + bp->flags &= ~BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED; } static bool bnxt_vf_pciid(uint16_t id) -- 2.20.1 (Apple Git-117)