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 78B8FA32A1 for ; Thu, 24 Oct 2019 08:07:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F7621C1E5; Thu, 24 Oct 2019 08:07:18 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 20A891C18F for ; Thu, 24 Oct 2019 08:06:59 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 9120E28FA8F; Wed, 23 Oct 2019 23:06:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 9120E28FA8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571897218; bh=2tGul3N6VKnpTcx+peUw8FGU26gZ0uVlyTD3knIpQbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWUNIJmfH9DPYKYgpq1Jz3rhN8k0yPmHaYju4ydKSoXgNmoT5wGFp6i8qdBPHx8LO qxZE2+UlbgiLrJWd5uJDfNfcrkO16BAiISxZuWxOdaAbJ/czp79P1VPpOT1lnQIlyY QtX0gjN/6RulekWxVij/U8SbHWf7GDA4rBtI8e1s= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 11:29:03 +0530 Message-Id: <20191024055913.28817-9-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024055913.28817-1-somnath.kotur@broadcom.com> References: <20191024055913.28817-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 08/16] net/bnxt: fix a possible race between start and interrupt handler 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 During port start, driver enables interrupts. At the end of port start driver schedules the alarm for fw health check. This can cause race between interrupt handler and schedule fw health check alarm thread which falsely detects FW error. Fixes: 241f043a3c8f ("net/bnxt: handle firmware reset status during port start") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Kumar Khaparde Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 820005c..e24fd41 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -869,7 +869,9 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) bp->flags |= BNXT_FLAG_INIT_DONE; eth_dev->data->dev_started = 1; bp->dev_stopped = 0; + pthread_mutex_lock(&bp->def_cp_lock); bnxt_schedule_fw_health_check(bp); + pthread_mutex_unlock(&bp->def_cp_lock); return 0; error: -- 1.8.3.1