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 72D4BA32A1 for ; Thu, 24 Oct 2019 09:53:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE0ED1D454; Thu, 24 Oct 2019 09:52:50 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 8F0541D411 for ; Thu, 24 Oct 2019 09:52:28 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 5F9BC1B44E7; Thu, 24 Oct 2019 00:52:27 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 5F9BC1B44E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571903548; bh=Hoaq4nm+sH+PwvcZg+j0gK3K1H69rRiFgJWiFregKUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wDXlvJnAhqju4VX/6kmSeGW2up6b7jlEVzBa4hj9HRQfIMwhwCKy+Z6XU0+tUFcqx 3g7jBYalT3seURpM9qzYD02KkY7zHB8pdDweZCBWoTNMfH/lGcI+yaXHuz/7BOs0NB shVkl4q01CHgeIRbac8m01AHyp2A9z++/AzmkLw8= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 13:14:23 +0530 Message-Id: <20191024074432.30705-9-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024074432.30705-1-somnath.kotur@broadcom.com> References: <20191024074432.30705-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 08/17] 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: -- 2.10.1.613.g2cc2e70