[dpdk-dev] [PATCH 08/17] net/bnxt: fix a possible race between start and interrupt handler

Somnath Kotur somnath.kotur at broadcom.com
Thu Oct 24 09:44:23 CEST 2019


From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>

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 <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde at broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 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



More information about the dev mailing list