patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Dengdui Huang <huangdengdui@huawei.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: patch 'net/hns3: fix multiple reset detected log' has been queued to stable release 21.11.6
Date: Thu, 16 Nov 2023 13:22:57 +0000	[thread overview]
Message-ID: <20231116132348.557257-15-ktraynor@redhat.com> (raw)
In-Reply-To: <20231116132348.557257-1-ktraynor@redhat.com>

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/0bc0e51d06d5d2137675c4a28a1c18e73664d79f

Thanks.

Kevin

---
From 0bc0e51d06d5d2137675c4a28a1c18e73664d79f Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 27 Oct 2023 14:09:44 +0800
Subject: [PATCH] net/hns3: fix multiple reset detected log

[ upstream commit 5be38fc6c0fc7e54d0121bab2fe93a27b8e8f7ab ]

Currently, the driver proactively checks whether interrupt exist
(by checking reset registers), related reset delay task is scheduled.

When a reset whose level is equal to or lower than the current level
is detected, there is unnecessary to add delay task and print logs.

This patch fix it.

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

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

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 9712fbfe6f..90eec4a09b 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -129,6 +129,5 @@ hns3_pf_enable_irq0(struct hns3_hw *hw)
 
 static enum hns3_evt_cause
-hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
-			  uint32_t *vec_val)
+hns3_proc_imp_reset_event(struct hns3_adapter *hns, uint32_t *vec_val)
 {
 	struct hns3_hw *hw = &hns->hw;
@@ -137,11 +136,6 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
 	hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
 	*vec_val = BIT(HNS3_VECTOR0_IMPRESET_INT_B);
-	if (!is_delay) {
-		hw->reset.stats.imp_cnt++;
-		hns3_warn(hw, "IMP reset detected, clear reset status");
-	} else {
-		hns3_schedule_delayed_reset(hns);
-		hns3_warn(hw, "IMP reset detected, don't clear reset status");
-	}
+	hw->reset.stats.imp_cnt++;
+	hns3_warn(hw, "IMP reset detected, clear reset status");
 
 	return HNS3_VECTOR0_EVENT_RST;
@@ -149,6 +143,5 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
 
 static enum hns3_evt_cause
-hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,
-			     uint32_t *vec_val)
+hns3_proc_global_reset_event(struct hns3_adapter *hns, uint32_t *vec_val)
 {
 	struct hns3_hw *hw = &hns->hw;
@@ -157,12 +150,6 @@ hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,
 	hns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);
 	*vec_val = BIT(HNS3_VECTOR0_GLOBALRESET_INT_B);
-	if (!is_delay) {
-		hw->reset.stats.global_cnt++;
-		hns3_warn(hw, "Global reset detected, clear reset status");
-	} else {
-		hns3_schedule_delayed_reset(hns);
-		hns3_warn(hw,
-			  "Global reset detected, don't clear reset status");
-	}
+	hw->reset.stats.global_cnt++;
+	hns3_warn(hw, "Global reset detected, clear reset status");
 
 	return HNS3_VECTOR0_EVENT_RST;
@@ -178,5 +165,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 	uint32_t val;
 	enum hns3_evt_cause ret;
-	bool is_delay;
 
 	/* fetch the events from their corresponding regs */
@@ -185,5 +171,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 	hw_err_src_reg = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);
 
-	is_delay = clearval == NULL ? true : false;
 	/*
 	 * Assumption: If by any chance reset and mailbox events are reported
@@ -194,5 +179,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 	 */
 	if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_int_stats) { /* IMP */
-		ret = hns3_proc_imp_reset_event(hns, is_delay, &val);
+		ret = hns3_proc_imp_reset_event(hns, &val);
 		goto out;
 	}
@@ -200,5 +185,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 	/* Global reset */
 	if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_int_stats) {
-		ret = hns3_proc_global_reset_event(hns, is_delay, &val);
+		ret = hns3_proc_global_reset_event(hns, &val);
 		goto out;
 	}
@@ -229,8 +214,7 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 	val = vector0_int_stats;
 	ret = HNS3_VECTOR0_EVENT_OTHER;
-out:
 
-	if (clearval)
-		*clearval = val;
+out:
+	*clearval = val;
 	return ret;
 }
@@ -5566,4 +5550,30 @@ is_pf_reset_done(struct hns3_hw *hw)
 }
 
+static void
+hns3_detect_reset_event(struct hns3_hw *hw)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+	enum hns3_reset_level new_req = HNS3_NONE_RESET;
+	enum hns3_reset_level last_req;
+	uint32_t vector0_intr_state;
+
+	last_req = hns3_get_reset_level(hns, &hw->reset.pending);
+	vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
+	if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) {
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
+		new_req = HNS3_IMP_RESET;
+	} else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) {
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);
+		new_req = HNS3_GLOBAL_RESET;
+	}
+
+	if (new_req != HNS3_NONE_RESET && last_req < new_req) {
+		hns3_schedule_delayed_reset(hns);
+		hns3_warn(hw, "High level reset detected, delay do reset");
+	}
+}
+
 bool
 hns3_is_reset_pending(struct hns3_adapter *hns)
@@ -5579,5 +5589,5 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
 		return false;
 
-	hns3_check_event_cause(hns, NULL);
+	hns3_detect_reset_event(hw);
 	reset = hns3_get_reset_level(hns, &hw->reset.pending);
 	if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-16 13:21:52.935085160 +0000
+++ 0015-net-hns3-fix-multiple-reset-detected-log.patch	2023-11-16 13:21:52.426946305 +0000
@@ -1 +1 @@
-From 5be38fc6c0fc7e54d0121bab2fe93a27b8e8f7ab Mon Sep 17 00:00:00 2001
+From 0bc0e51d06d5d2137675c4a28a1c18e73664d79f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5be38fc6c0fc7e54d0121bab2fe93a27b8e8f7ab ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 3bdce1fa4b..18afc0fa0a 100644
+index 9712fbfe6f..90eec4a09b 100644
@@ -26 +27 @@
-@@ -125,6 +125,5 @@ hns3_pf_enable_irq0(struct hns3_hw *hw)
+@@ -129,6 +129,5 @@ hns3_pf_enable_irq0(struct hns3_hw *hw)
@@ -34 +35 @@
-@@ -133,11 +132,6 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
+@@ -137,11 +136,6 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
@@ -48 +49 @@
-@@ -145,6 +139,5 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
+@@ -149,6 +143,5 @@ hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
@@ -56 +57 @@
-@@ -153,12 +146,6 @@ hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,
+@@ -157,12 +150,6 @@ hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,
@@ -71 +72 @@
-@@ -174,5 +161,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
+@@ -178,5 +165,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
@@ -77 +78 @@
-@@ -181,5 +167,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
+@@ -185,5 +171,4 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
@@ -83 +84 @@
-@@ -190,5 +175,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
+@@ -194,5 +179,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
@@ -90 +91 @@
-@@ -196,5 +181,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
+@@ -200,5 +185,5 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
@@ -97 +98 @@
-@@ -225,8 +210,7 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
+@@ -229,8 +214,7 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
@@ -108 +109 @@
-@@ -5506,4 +5490,30 @@ is_pf_reset_done(struct hns3_hw *hw)
+@@ -5566,4 +5550,30 @@ is_pf_reset_done(struct hns3_hw *hw)
@@ -139 +140 @@
-@@ -5519,5 +5529,5 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
+@@ -5579,5 +5589,5 @@ hns3_is_reset_pending(struct hns3_adapter *hns)


  parent reply	other threads:[~2023-11-16 13:24 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 13:22 patch 'eventdev: fix device pointer for vdev-based devices' " Kevin Traynor
2023-11-16 13:22 ` patch 'eventdev: fix missing driver names in info struct' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/virtio: fix missing next flag in Tx packed ring' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/virtio: fix link state interrupt vector setting' " Kevin Traynor
2023-11-16 13:22 ` patch 'vhost: fix missing vring call check on virtqueue access' " Kevin Traynor
2023-11-16 13:22 ` patch 'vhost: fix missing " Kevin Traynor
2023-11-16 13:22 ` patch 'vhost: fix check on virtqueue access in async registration' " Kevin Traynor
2023-11-16 13:22 ` patch 'vhost: fix check on virtqueue access in in-flight getter' " Kevin Traynor
2023-11-16 13:22 ` patch 'common/cnxk: fix pool buffer size in opaque mode' " Kevin Traynor
2023-11-16 13:22 ` patch 'ethdev: fix function name in comment' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/hns3: fix typo in function name' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/hns3: fix unchecked Rx free threshold' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/hns3: fix double stats for IMP and global reset' " Kevin Traynor
2023-11-16 13:22 ` patch 'net/hns3: remove reset log in secondary' " Kevin Traynor
2023-11-16 13:22 ` Kevin Traynor [this message]
2023-11-16 13:22 ` patch 'net/hns3: refactor interrupt state query' " Kevin Traynor
2023-11-16 13:22 ` patch 'test/bonding: remove unreachable statement' " Kevin Traynor
2023-11-16 13:23 ` patch 'test/bonding: add missing check' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/bonding: fix possible overrun' " Kevin Traynor
2023-11-16 13:23 ` patch 'ethdev: fix 32-bit build with GCC 13' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/enic: avoid extra unlock in MTU set' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/hns3: fix some return values' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/hns3: fix some error logs' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/hns3: keep set/get algo key functions local' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/hns3: fix uninitialized hash algo value' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/tap: fix L4 checksum offloading' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/tap: fix IPv4 " Kevin Traynor
2023-11-16 13:23 ` patch 'app/procinfo: fix RSS info' " Kevin Traynor
2023-11-16 13:23 ` patch 'app/procinfo: adjust format of " Kevin Traynor
2023-11-16 13:23 ` patch 'net/tap: fix RSS for fragmented packets' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix decap action checking in sample flow' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix E-Switch mirror flow rule validation' " Kevin Traynor
2023-11-16 13:23 ` patch 'common/mlx5: fix controller index parsing' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/ice: fix L1 check interval' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/iavf: fix Tx offload mask' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/iavf: fix indent in Tx path' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/iavf: fix Tx offload flags check' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/ice: fix DCF port statistics' " Kevin Traynor
2023-11-16 13:23 ` patch 'crypto/nitrox: fix panic with high number of segments' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/iavf: fix Tx preparation' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/ice: " Kevin Traynor
2023-11-16 13:23 ` patch 'config/arm: fix aarch32 build with GCC 13' " Kevin Traynor
2023-11-16 13:23 ` patch 'build: add libarchive to optional external dependencies' " Kevin Traynor
2023-11-17  9:00   ` Richardson, Bruce
2023-11-20 13:58     ` Kevin Traynor
2023-11-16 13:23 ` patch 'app/dumpcap: fix mbuf pool ring type' " Kevin Traynor
2023-11-16 13:23 ` patch 'event/dlb2: fix name check in self-test' " Kevin Traynor
2023-11-16 13:23 ` patch 'test/bbdev: fix Python script subprocess' " Kevin Traynor
2023-11-16 13:23 ` patch 'test/bbdev: assert failed test for queue configure' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/ice: fix crash on closing representor ports' " Kevin Traynor
2023-11-16 13:23 ` patch 'event/dlb2: fix missing queue ordering capability flag' " Kevin Traynor
2023-11-16 13:23 ` patch 'meter: fix RFC4115 trTCM API Doxygen' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/sfc: remove null dereference in log' " Kevin Traynor
2023-11-16 13:23 ` patch 'app/testpmd: remove useless check in TSO command' " Kevin Traynor
2023-11-16 13:23 ` patch 'ethdev: account for smaller MTU when setting default' " Kevin Traynor
2023-11-16 13:23 ` patch 'test/bonding: fix uninitialized RSS configuration' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/hns3: fix mailbox sync' " Kevin Traynor
2023-11-16 13:23 ` patch 'app/testpmd: fix tunnel TSO capability check' " Kevin Traynor
2023-11-16 13:23 ` patch 'app/testpmd: add explicit check for tunnel TSO' " Kevin Traynor
2023-11-16 13:23 ` patch 'app/testpmd: fix tunnel TSO configuration' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix validation of sample encap flow action' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix use after free on Rx queue start' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix hairpin queue states' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix multi-segment Tx inline data length' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: fix shared Rx queue list management' " Kevin Traynor
2023-11-16 13:23 ` patch 'net/mlx5: zero UDP checksum over IPv4 in encapsulation' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231116132348.557257-15-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=huangdengdui@huawei.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).