From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5FDB643C63 for ; Thu, 7 Mar 2024 02:36:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52DC042EF8; Thu, 7 Mar 2024 02:36:07 +0100 (CET) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 50A5742E64 for ; Thu, 7 Mar 2024 02:36:06 +0100 (CET) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4130fefef75so1006955e9.2 for ; Wed, 06 Mar 2024 17:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775366; x=1710380166; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IxNPIGFOc+1Nl+MgKtu20NrvyMwe3d+OTpfgk3sr4aE=; b=F1/roc2dYIawPSYKVn2fhBAluWL5GwHpBu/Lgy/XL3m0sRfdiUXLmfBmGfSA171Mm9 I74XMwCUKhFCsbuo0wPNJn1UZuJJ5e0+7bkk8G0xWwbnfagjh3mw4KOBR2JWdcNWShNK oAukIj1v85bBkyU37XZHWSNwnUlDjyc6puTGpzGZoL1HiN14BK8skMYpZvv2hhCTG8hb 81Mse6pmVkjYODi9df49BpgsbahSSd7YGXQnaUjROy/8tOWDBrdd3UUqErb3zPMfskF0 E31Y7RirexoyOb6AIGFzQaB9XZN8wT4WNio7umUA6y0g/WdSc0Gj/W210KdST+C0k8FO sy9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775366; x=1710380166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IxNPIGFOc+1Nl+MgKtu20NrvyMwe3d+OTpfgk3sr4aE=; b=hQbbUHOZpuGbKhtMZS5IUX0zcI25sGy1ClFIpK5QYFyx5pwZey/Ks1CUtHcHz6FGBM rfnIxAypqJ/xnLvUFKGAR4clOaTQ5laPhFZJ0MICun/tNHx/1sibkkm4f3J44srICQYP RS2keoCO+PmqGEvN9DeGLyNIQNKT1Lh5VXHJKlK/JADFnD2LC2ftmyllzj1V8/pke55n TI4CLpbh1i+TJ+o2KeQF501l97/nrfThUKJkVEbxTBA9H2JcT7HeRnmdQJ99+vWG5gDF FD4fvikaL1NeuNqpAtwpOZict3UEe8pjvxYVLmiXlVvTY9MGOM8+S+naDQzYg8E1unUl 9KJQ== X-Forwarded-Encrypted: i=1; AJvYcCWgltJV4rHzyXGiLkSEhr6pwKImqxNUgr1nREf+G2QVCiRj+ym5bwjzqNh4r0KGbHKcJPFpPVyPfQsSX8GwL64= X-Gm-Message-State: AOJu0YxoyCKuUaVTVaZC0eo1rcqb1Yl8j63mueTLJ7S+GyIVFKSZ940r UYR4N4SmobFy577oS8Burs7qqx0HnNM2h2nsIS9GpvLWLrZITcziMWwtffknK5o= X-Google-Smtp-Source: AGHT+IGqtC7wQAMC/k1xzk/m+obkM4RcLkrZj/BZ9IXpJlM2zTDqLjOprrgkl7yfBIutYeakwvAcpw== X-Received: by 2002:a05:600c:4ec9:b0:412:ef25:aa91 with SMTP id g9-20020a05600c4ec900b00412ef25aa91mr4299368wmq.18.1709775365939; Wed, 06 Mar 2024 17:36:05 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c419300b0041294d015fbsm853129wmh.40.2024.03.06.17.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:36:05 -0800 (PST) From: luca.boccassi@gmail.com To: Dengdui Huang Cc: Jie Hai , dpdk stable Subject: patch 'net/hns3: fix reset level comparison' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:24 +0000 Message-Id: <20240307013159.1735343-67-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/75120a950ee642ff0ad1b5e0abbfff9988bb9aa7 Thanks. Luca Boccassi --- >From 75120a950ee642ff0ad1b5e0abbfff9988bb9aa7 Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Fri, 8 Dec 2023 15:44:16 +0800 Subject: [PATCH] net/hns3: fix reset level comparison [ upstream commit 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 ] Currently, there are two problems in hns3vf_is_reset_pending(): 1. The new detect reset level is not HNS3_NONE_RESET, but the last reset level is HNS3_NONE_RESET, this function returns false. 2. Comparison between last_req and new_req is opposite. In addition, the reset level comparison in hns3_detect_reset_event() is similar to the hns3vf_is_reset_pending(). So this patch fixes above the problems and merges the logic of reset level comparison. Fixes: 5be38fc6c0fc ("net/hns3: fix multiple reset detected log") Signed-off-by: Dengdui Huang Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_ethdev.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index d34094c9a5..eb4223305a 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5579,27 +5579,15 @@ is_pf_reset_done(struct hns3_hw *hw) static enum hns3_reset_level 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) new_req = HNS3_IMP_RESET; else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) new_req = HNS3_GLOBAL_RESET; - if (new_req == HNS3_NONE_RESET) - return HNS3_NONE_RESET; - - if (last_req == HNS3_NONE_RESET || last_req < new_req) { - __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); - hns3_schedule_delayed_reset(hns); - hns3_warn(hw, "High level reset detected, delay do reset"); - } - return new_req; } @@ -5618,10 +5606,14 @@ hns3_is_reset_pending(struct hns3_adapter *hns) return false; new_req = hns3_detect_reset_event(hw); + if (new_req == HNS3_NONE_RESET) + return false; + last_req = hns3_get_reset_level(hns, &hw->reset.pending); - if (last_req != HNS3_NONE_RESET && new_req != HNS3_NONE_RESET && - new_req < last_req) { - hns3_warn(hw, "High level reset %d is pending", last_req); + if (last_req == HNS3_NONE_RESET || last_req < new_req) { + __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); + hns3_schedule_delayed_reset(hns); + hns3_warn(hw, "High level reset detected, delay do reset"); return true; } last_req = hns3_get_reset_level(hns, &hw->reset.request); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:40.542755121 +0000 +++ 0067-net-hns3-fix-reset-level-comparison.patch 2024-03-07 01:05:34.882941799 +0000 @@ -1 +1 @@ -From 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 Mon Sep 17 00:00:00 2001 +From 75120a950ee642ff0ad1b5e0abbfff9988bb9aa7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index d626bdd5b1..eafcf2c6f6 100644 +index d34094c9a5..eb4223305a 100644 @@ -28 +29 @@ -@@ -5545,27 +5545,15 @@ is_pf_reset_done(struct hns3_hw *hw) +@@ -5579,27 +5579,15 @@ is_pf_reset_done(struct hns3_hw *hw) @@ -56 +57 @@ -@@ -5584,10 +5572,14 @@ hns3_is_reset_pending(struct hns3_adapter *hns) +@@ -5618,10 +5606,14 @@ hns3_is_reset_pending(struct hns3_adapter *hns)