From: Kalesh AP Date: Thu, 24 Oct 2019 07:44:23 +0000 (+0530) Subject: net/bnxt: fix race between start and interrupt handler X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a73b8e939f105eef6da876ccecf6a1a14f1f52e9;p=dpdk.git 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 --- 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: