From a73b8e939f105eef6da876ccecf6a1a14f1f52e9 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 24 Oct 2019 13:14:23 +0530 Subject: [PATCH] net/bnxt: fix race between start and interrupt handler 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: 9d0cbaecc91a ("net/bnxt: support periodic FW health monitoring") Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- 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 820005cc06..e24fd41202 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.20.1