[1/3] net/hns3: fix reset detect be ignored

Message ID 20231127133903.1138657-2-huangdengdui@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series fix some bug for hns3 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dengdui Huang Nov. 27, 2023, 1:39 p.m. UTC
  The code logic that only new reset whose level is higher than old
reset level will be addressed is added in hns3_detect_reset_event,
see commit 5be38fc6c0fc ("net/hns3: fix multiple reset detected log").
When the new reset is detected and the old reset level is HNS3_NONE_RESET
this reset will be ignored. This patch fix it.

Fixes: 5be38fc6c0fc ("net/hns3: fix multiple reset detected log")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 941d047bf1..ae81368f68 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5560,7 +5560,10 @@  hns3_detect_reset_event(struct hns3_hw *hw)
 		new_req = HNS3_GLOBAL_RESET;
 	}
 
-	if (new_req != HNS3_NONE_RESET && last_req < new_req) {
+	if (new_req == HNS3_NONE_RESET)
+		return HNS3_NONE_RESET;
+
+	if (last_req == HNS3_NONE_RESET || last_req < new_req) {
 		hns3_schedule_delayed_reset(hns);
 		hns3_warn(hw, "High level reset detected, delay do reset");
 	}