[dpdk-stable] [PATCH 20.11] net/hns3: fix concurrent interrupt handling

Min Hu (Connor) humin29 at huawei.com
Sun Jun 13 09:12:30 CEST 2021


From: Hongbo Zheng <zhenghongbo3 at huawei.com>

[ upstream commit f9f24ecd794f88231110c823cdeff5d7ec9a4382 ]

Currently, if RAS interrupt and FLR occurred at the same time, FLR will
be detected and corresponding schedule state will be set during RAS
interrupt processing. However, the schedule state value will be
overridden in subsequent RAS processing, resulting in FLR processing
failure. This patch solves this problem.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable at dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3 at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_intr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 99b5301..0bba3ab 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -1787,7 +1787,8 @@ hns3_schedule_reset(struct hns3_adapter *hns)
 		return;
 	if (rte_atomic16_read(&hns->hw.reset.schedule) == SCHEDULE_DEFERRED)
 		rte_eal_alarm_cancel(hw->reset.ops->reset_service, hns);
-	rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED);
+	else
+		rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED);
 
 	rte_eal_alarm_set(SWITCH_CONTEXT_US, hw->reset.ops->reset_service, hns);
 }
-- 
2.7.4



More information about the stable mailing list