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 0559FA0547 for ; Mon, 8 Feb 2021 12:15:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E34C840147; Mon, 8 Feb 2021 12:15:01 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 8920740147 for ; Mon, 8 Feb 2021 12:15:00 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l94VQ-0001Ac-AH; Mon, 08 Feb 2021 11:15:00 +0000 From: Christian Ehrhardt To: Chengchang Tang Cc: Lijun Ou , dpdk stable Date: Mon, 8 Feb 2021 12:14:23 +0100 Message-Id: <20210208111429.1875789-11-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208111429.1875789-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> <20210208111429.1875789-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix VF reset on mailbox failure' has been queued to stable release 19.11.7 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 19.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/10/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/47f2ed5d5fb019e86e6955a638a7c19331d7d46e Thanks. Christian Ehrhardt --- >From 47f2ed5d5fb019e86e6955a638a7c19331d7d46e Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Wed, 3 Feb 2021 20:23:56 +0800 Subject: [PATCH] net/hns3: fix VF reset on mailbox failure [ upstream commit ff81c6b7d053d19fa5d766de449e9a1a462661f5 ] Currently, during the VF reset, the VF will send a MBX to inform PF to reset it and the disable command bit will be set whether the MBX is successful. Generally, multiple reset attempts are made after a failure. However, because the command is disabled, all subsequent reset will all fail. This patch disable the command only after the MBX message is successfully. Fixes: 2790c6464725 ("net/hns3: support device reset") Signed-off-by: Chengchang Tang Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index f7bd2b4672..09a8d31ff4 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1970,15 +1970,17 @@ static int hns3vf_prepare_reset(struct hns3_adapter *hns) { struct hns3_hw *hw = &hns->hw; - int ret = 0; + int ret; if (hw->reset.level == HNS3_VF_FUNC_RESET) { ret = hns3_send_mbx_msg(hw, HNS3_MBX_RESET, 0, NULL, 0, true, NULL, 0); + if (ret) + return ret; } rte_atomic16_set(&hw->reset.disable_cmd, 1); - return ret; + return 0; } static int -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-08 12:04:29.958796357 +0100 +++ 0011-net-hns3-fix-VF-reset-on-mailbox-failure.patch 2021-02-08 12:04:29.543496793 +0100 @@ -1 +1 @@ -From ff81c6b7d053d19fa5d766de449e9a1a462661f5 Mon Sep 17 00:00:00 2001 +From 47f2ed5d5fb019e86e6955a638a7c19331d7d46e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ff81c6b7d053d19fa5d766de449e9a1a462661f5 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 4f9da4a56c..a607bd3a91 100644 +index f7bd2b4672..09a8d31ff4 100644 @@ -28 +29 @@ -@@ -2404,15 +2404,17 @@ static int +@@ -1970,15 +1970,17 @@ static int @@ -41 +42 @@ - __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); + rte_atomic16_set(&hw->reset.disable_cmd, 1);