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 055AE432DA for ; Wed, 8 Nov 2023 20:26:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2DA442D66; Wed, 8 Nov 2023 20:26:12 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id E149442D66 for ; Wed, 8 Nov 2023 20:26:11 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4084de32db5so4665e9.0 for ; Wed, 08 Nov 2023 11:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471571; x=1700076371; 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=n2uJtU1psoASOOEgWSw58Q+NdM51nxbumM79C3YvvdQ=; b=Tq/1ILx6pjB9PdNLNPgxFDmNU7uJJA+HPBlDS3YZ9sCjsHLSTYhFV3NBSOnqRB0bxU aZx4WGecMvnkdw/QBG3WblBV+bEAWV2SOeene7AEPoD3qx8LnxRSrY7/9R4+m65kJ47d ghW6b4Q/ZeFdXEJ6KIrfLMdNLtIkdWQ6+dS+vd15Illlr6poef9QM4p9/uYrZybeZKNJ GjvEhGr/9lWSRC3mvTAE5RloXKc3GIaTf/KlBAgUSl5MJ4So2Phafxw+HlPy/Q9rMYts YtZ1BTPNPCtCTj1ff7I2jY2AtZ5sg17GoT8V/48j6hZEi9CZiyG90UWbE/hBwXcEEkKy H1lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471571; x=1700076371; 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=n2uJtU1psoASOOEgWSw58Q+NdM51nxbumM79C3YvvdQ=; b=p0F/YkQeuhn1tPwDdqOoFVGmdgwpTLYj3erLAQJAyZ0rqvnqYx1MlZYE0UxC7qsZ4/ /9Y7aNCHXkal+RK7DPh3B7Gz9JSMuRnkhyBJCiDlF969N/tNvva00ZnxhYMRjx+rTeg3 AF5LUfbz6nFJEcoXATcA175J0rmpN+bSfGRtdvIi8qtY+/QmGLm7HRWUQsnwkayoPUza bTEXPM2OP+/0yccoS93zL2DIoWEeqwon/PoY5kHzpG3nj+cMB7qpcvsuYaG0BfYGF6E2 cVUiKR6Zbv0QtRTLFrJK00QrVADQcequlYnfImQChS47Fcc8oymwArG0IJeKm4D63Qf7 iDsw== X-Gm-Message-State: AOJu0Yz6CV8uqCgX8IuUsdk1Ini5Fto75uBwmYVTSEhCjSvSwaot+Fc7 yBackg1tRKVb1FeJMy24PMg= X-Google-Smtp-Source: AGHT+IGk+7cybk/e9oyW1cNEO0hADbWh6mOUKhOnFEwo1cgEPs2EiuLa8mRtRrP3AVmz0IlhNFVrFw== X-Received: by 2002:a05:600c:4f87:b0:407:5b54:bb15 with SMTP id n7-20020a05600c4f8700b004075b54bb15mr2585115wmq.36.1699471571523; Wed, 08 Nov 2023 11:26:11 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id a6-20020a056000100600b0031984b370f2sm5608684wrx.47.2023.11.08.11.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:26:11 -0800 (PST) From: luca.boccassi@gmail.com To: Dengdui Huang Cc: dpdk stable Subject: patch 'net/hns3: fix double stats for IMP and global reset' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:10 +0000 Message-Id: <20231108192535.922238-12-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108192535.922238-1-luca.boccassi@gmail.com> References: <20231018235930.3144-41-luca.boccassi@gmail.com> <20231108192535.922238-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 20.11.10 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/10/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/0e1cff3cf2fe665acffebb182c4d3b5068aaf48b Thanks. Luca Boccassi --- >From 0e1cff3cf2fe665acffebb182c4d3b5068aaf48b Mon Sep 17 00:00:00 2001 From: Dengdui Huang 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 --- 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 7e945ba2e3..190c964635 100644 --- a/drivers/net/hns3/hns3_intr.c +++ b/drivers/net/hns3/hns3_intr.c @@ -1781,8 +1781,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); - else - rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED); + + rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED); rte_eal_alarm_set(SWITCH_CONTEXT_US, hw->reset.ops->reset_service, hns); } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:52.607432108 +0000 +++ 0012-net-hns3-fix-double-stats-for-IMP-and-global-reset.patch 2023-11-08 19:23:51.761396044 +0000 @@ -1 +1 @@ -From c48e74370c5eafbe8db5c826a797344e4fdf8f49 Mon Sep 17 00:00:00 2001 +From 0e1cff3cf2fe665acffebb182c4d3b5068aaf48b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c48e74370c5eafbe8db5c826a797344e4fdf8f49 ] + @@ -35 +36,0 @@ -Cc: stable@dpdk.org @@ -43 +44 @@ -index 44a1119415..baf5f58e9e 100644 +index 7e945ba2e3..190c964635 100644 @@ -46,3 +47,3 @@ -@@ -2434,8 +2434,8 @@ hns3_schedule_reset(struct hns3_adapter *hns) - if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) == - SCHEDULE_DEFERRED) +@@ -1781,8 +1781,8 @@ hns3_schedule_reset(struct hns3_adapter *hns) + return; + if (rte_atomic16_read(&hns->hw.reset.schedule) == SCHEDULE_DEFERRED) @@ -51 +52 @@ -- __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED, +- rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED); @@ -53,2 +54 @@ -+ __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED, - __ATOMIC_RELAXED); ++ rte_atomic16_set(&hns->hw.reset.schedule, SCHEDULE_REQUESTED); @@ -56,0 +57 @@ + }