patch 'net/hns3: fix double stats for IMP and global reset' has been queued to stable release 21.11.6

Kevin Traynor ktraynor at redhat.com
Thu Nov 16 14:22:55 CET 2023


Hi,

FYI, your patch has been queued to stable release 21.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/21/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/efe611f1c844bff1115d00f17fb0c1f001db8d5e

Thanks.

Kevin

---
>From efe611f1c844bff1115d00f17fb0c1f001db8d5e Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Fri, 27 Oct 2023 14:09:42 +0800
Subject: [PATCH] net/hns3: fix double stats for IMP and global reset

[ upstream commit c48e74370c5eafbe8db5c826a797344e4fdf8f49 ]

There is a stats counter for IMP and global reset in PF driver.
hns3 driver has two following task to detect reset event:
(1) interrupt handled task(A): triggered by interrupt and detect
    which reset level. And the reset service will be executed
    after 10us.
(2) polling task(B): scan reset source register to detect if
    driver has to do reset. And the reset service will be executed
    after deferred 3s.

They'll both count the number of one reset plus 1.
Task(A) adds it before doing the reset service. And in the reset service,
task(B) adds it if hw->reset.schedule is 'SCHEDULE_REQUESTED'.
Normally, this reset counter is just added by 1 once. Unfortunately,
this counter is added by 2 in the following case:
1. Task(B) detect the reset event, like IMP. hw->reset.schedule is
   set to 'SCHEDULE_REQUESTED'.
2. Task(A) is just triggered before running the reset service of task(B).
   Note: the reset counter is added by 1 at this moment before running
   the reset service of task(A). Additionally, the reset service of
   task(B) is canceled in task(A) because of schedule status being
   'SCHEDULE_REQUESTED'.
3. Then the reset service of task(A) is executed at last.
   Note: The reset counter is added by 1 again in this step because of
   schedule status still being 'SCHEDULE_REQUESTED'.

So this patch fix it by setting the scheduling status to
'SCHEDULE_REQUESTED' in step 2.

Fixes: 2790c6464725 ("net/hns3: support device reset")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
---
 drivers/net/hns3/hns3_intr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 66dc509086..67a4b9b221 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -2420,6 +2420,6 @@ hns3_schedule_reset(struct hns3_adapter *hns)
 			    SCHEDULE_DEFERRED)
 		rte_eal_alarm_cancel(hw->reset.ops->reset_service, hns);
-	else
-		__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
+
+	__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
 				 __ATOMIC_RELAXED);
 
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-16 13:21:52.888342846 +0000
+++ 0013-net-hns3-fix-double-stats-for-IMP-and-global-reset.patch	2023-11-16 13:21:52.415946273 +0000
@@ -1 +1 @@
-From c48e74370c5eafbe8db5c826a797344e4fdf8f49 Mon Sep 17 00:00:00 2001
+From efe611f1c844bff1115d00f17fb0c1f001db8d5e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c48e74370c5eafbe8db5c826a797344e4fdf8f49 ]
+
@@ -35 +36,0 @@
-Cc: stable at dpdk.org
@@ -43 +44 @@
-index 44a1119415..baf5f58e9e 100644
+index 66dc509086..67a4b9b221 100644
@@ -46 +47 @@
-@@ -2435,6 +2435,6 @@ hns3_schedule_reset(struct hns3_adapter *hns)
+@@ -2420,6 +2420,6 @@ hns3_schedule_reset(struct hns3_adapter *hns)



More information about the stable mailing list