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 B850DA0C47 for ; Mon, 26 Jul 2021 15:55:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2FC2410EC; Mon, 26 Jul 2021 15:55:37 +0200 (CEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 7BCDD40DDA for ; Mon, 26 Jul 2021 15:55:36 +0200 (CEST) Received: by mail-wr1-f49.google.com with SMTP id p5so6092521wro.7 for ; Mon, 26 Jul 2021 06:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wmOtd3Zgx7Wl/oer8ZQ+T8k0FFSzL8qrUTkE/+pFyt4=; b=FfJrzTrSJy4LfUoB1ZneNpYF8LQkGtocnCnU0JR6n16osedZ2Bkp8l0+azSr75KD7w +enA0zoHytRlJhnPd5JlH0/cz8ijZc1CsZXotfDQ9/qtoKmvmJ6B21nh9fwFKTdeh8DF GiXJNSyxL3V7neJL2c2pHINICYc9N0CbR7z/uUHkO6rByIBjlidFnSPm/nI6TzXvWxFz ihqtD/edwiAYzNcbTcVtsFfe2++O6qfAc9MHU/m5dwiviixkhI8pA9mIM14U/F5Z7YRV OqaqhbHrBlo+TIfJQZkb1WI4rRn43Rxt9pp17C5oZuGyjs3y+Tz0i+mf1sKygMTkr9ss C/1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wmOtd3Zgx7Wl/oer8ZQ+T8k0FFSzL8qrUTkE/+pFyt4=; b=YIwv9s3Pe54UNt35LBoc198l4n4e25FDZLP2bCcavMGOd2tsPUyM5la7fpXgEBLaQG 7GWh7Rv296CS+IHUs2UlefEZl93leFpVKJp7nGZpo0RcZItNZ5tIkMGPa5HtRQWDQe91 wiYMTThnN23KgIcV2m51+RaeHWtYYA9+k0fl2vaCdoMtWLSbMR96x1ErfoGc7csoUqpf LWey8aaTEPUNfVNOhQV63mghTc/vxahkkimqyAFZCdgtSomOEhnV1BI1NgB4OdPBy4ja SPlwbDr26t0mJxOO4S6s0vtUsqJBzviAkwShQcP8cwQDmyxMmUjS3ZkKvIP3Rhp3DU65 u3iQ== X-Gm-Message-State: AOAM533NiSI4TibjVQERG9SFfr3RURzUxuuWqcR/pkXVFOyJHkDF/BnM wDxETH299tSPJpG2JYhCTKo= X-Google-Smtp-Source: ABdhPJxXoFRhAhn5CavKSRK2uhfx3e5jlIEhs1Z6wujjDBRCAVdE9aa8CRwPnXamUWmXx9jPxPgajw== X-Received: by 2002:a5d:4b46:: with SMTP id w6mr19728600wrs.352.1627307736244; Mon, 26 Jul 2021 06:55:36 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id t16sm13390863wmj.16.2021.07.26.06.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:55:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Hongbo Zheng Cc: Min Hu , dpdk stable Date: Mon, 26 Jul 2021 14:53:05 +0100 Message-Id: <20210726135322.149850-42-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix timing of clearing interrupt source' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/21. 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/fc0e7a4358b0245b8386240693d070385937490f Thanks. Luca Boccassi --- >From fc0e7a4358b0245b8386240693d070385937490f Mon Sep 17 00:00:00 2001 From: Hongbo Zheng Date: Sat, 17 Jul 2021 10:02:52 +0800 Subject: [PATCH] net/hns3: fix timing of clearing interrupt source [ upstream commit ee930d38ffca82af6c70209be7a8f2b408dc5610 ] Currently, the PF/VF does not clear the interrupt source immediately after receiving the interrupt. As a result, if the second interrupt task is triggered when processing the first interrupt task, clearing the interrupt source before exiting will clear the interrupt sources of the two tasks at the same time. As a result, no interrupt is triggered for the second task. Clearing interrupt source immediately after checking event cause ensures that: 1. Even if two interrupt tasks are triggered at the same time, they can be processed. 2. If the second task is triggered during the processing of the first task and the interrupt source is not cleared, the interrupt is reported after vector0 is enabled. Fixes: a5475d61fa34 ("net/hns3: support VF") Fixes: 3988ab0eee52 ("net/hns3: add abnormal interrupt process") Signed-off-by: Hongbo Zheng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 1ddb2e1806..25a9af4382 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -239,6 +239,7 @@ hns3_interrupt_handler(void *param) hns3_pf_disable_irq0(hw); event_cause = hns3_check_event_cause(hns, &clearval); + hns3_clear_event_cause(hw, event_cause, clearval); /* vector 0 interrupt is shared with reset and mailbox source events. */ if (event_cause == HNS3_VECTOR0_EVENT_ERR) { hns3_warn(hw, "Received err interrupt"); @@ -253,7 +254,6 @@ hns3_interrupt_handler(void *param) else hns3_err(hw, "Received unknown event"); - hns3_clear_event_cause(hw, event_cause, clearval); /* Enable interrupt if it is not cause by reset */ hns3_pf_enable_irq0(hw); } diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 913484d2e3..24bc540456 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1116,6 +1116,8 @@ hns3vf_interrupt_handler(void *param) /* Read out interrupt causes */ event_cause = hns3vf_check_event_cause(hns, &clearval); + /* Clear interrupt causes */ + hns3vf_clear_event_cause(hw, clearval); switch (event_cause) { case HNS3VF_VECTOR0_EVENT_RST: @@ -1128,9 +1130,6 @@ hns3vf_interrupt_handler(void *param) break; } - /* Clear interrupt causes */ - hns3vf_clear_event_cause(hw, clearval); - /* Enable interrupt */ hns3vf_enable_irq0(hw); } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:18.109997104 +0100 +++ 0042-net-hns3-fix-timing-of-clearing-interrupt-source.patch 2021-07-26 13:53:15.917294052 +0100 @@ -1 +1 @@ -From ee930d38ffca82af6c70209be7a8f2b408dc5610 Mon Sep 17 00:00:00 2001 +From fc0e7a4358b0245b8386240693d070385937490f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ee930d38ffca82af6c70209be7a8f2b408dc5610 ] + @@ -23 +24,0 @@ -Cc: stable@dpdk.org @@ -33 +34 @@ -index 3699b5636e..f994c288a1 100644 +index 1ddb2e1806..25a9af4382 100644 @@ -36,4 +37,4 @@ -@@ -317,6 +317,7 @@ hns3_interrupt_handler(void *param) - vector0_int = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG); - ras_int = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG); - cmdq_int = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG); +@@ -239,6 +239,7 @@ hns3_interrupt_handler(void *param) + hns3_pf_disable_irq0(hw); + + event_cause = hns3_check_event_cause(hns, &clearval); @@ -43,4 +44,4 @@ - hns3_warn(hw, "received interrupt: vector0_int_stat:0x%x " -@@ -335,7 +336,6 @@ hns3_interrupt_handler(void *param) - vector0_int, ras_int, cmdq_int); - } + hns3_warn(hw, "Received err interrupt"); +@@ -253,7 +254,6 @@ hns3_interrupt_handler(void *param) + else + hns3_err(hw, "Received unknown event"); @@ -53 +54 @@ -index 8f3be64b0b..de659c05f0 100644 +index 913484d2e3..24bc540456 100644