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 C3149432DA for ; Wed, 8 Nov 2023 20:27:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD4C442E33; Wed, 8 Nov 2023 20:27:05 +0100 (CET) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mails.dpdk.org (Postfix) with ESMTP id E12F340395 for ; Wed, 8 Nov 2023 20:27:03 +0100 (CET) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-507a55302e0so48831e87.0 for ; Wed, 08 Nov 2023 11:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471623; x=1700076423; 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=yyoWhuiEzVeILeixIgvxZ0LfHH4RP7tJmanhUojuEK8=; b=nWpExqHmFMoyD8KfzLfWJBVkkXRSHa37gGqrBd7l1Ql1Yttg0y6afVc1QmQ3w2oQUX ccKyqwJVO2mIhcR6prFszgkuqdJQzXZ/lLaNOwnwJuK26zw9wtw+xI1QlhtzOjWkG3uT tB7gjXeVuE62/9N8giy8X365lJYPx1/fejHqFpaGWJrfq3Akqpz9qhydyQeDXXhHXl47 oLHxU/QmqrkSkZIBV/o9G7uoJY8KVBtN1lAjRnMqSHNqowak+yKlEJ83kGRktN/CMsox IoOd7zlJMPJe0zSlZ3Wd5Mrq7Rfo3qj1zd2F4+U98Pc9XgfTo4nURCFlLfvBMQBvM/yd UElw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471623; x=1700076423; 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=yyoWhuiEzVeILeixIgvxZ0LfHH4RP7tJmanhUojuEK8=; b=wp/oAUuG2m85/g7oMCtaWs1OYCal9+CNm5K8iBf3SIjvtfu//cdVKTcajjZrKixtQu f/9UY+O8/LYDpbygfkAvZ7pczYBDOYD+7095FsARS1oT/b6INnx8IWOPVrAmjDGn05ZN ac67a7gbqbHAmJJlilaoPfWI6F8jJbiQrnupxuFy1wuEGmfI+VnLyCIhSy0yLPWA/D+W X13QPBRZ8lt8NTgwHv80YS3FBvLUPb+eOC+c8BcVy45zFOv0tdv1Mf16XxDlWTPNJphY hAzeHS226N1wjn023DrYC0W8uUrC67R0Cy3+YJ40EP2aOl8xLrtUEJhz/0v1Kkrx5bZH CEDA== X-Gm-Message-State: AOJu0YzlULy6+ULBr4jYZlTybG1qgQWsRnSqgeqGCL3hBg5F1sMYXEaV TfUnZ1HC0dmAbVTFOpTmXWLPLavq9Ioy5Q== X-Google-Smtp-Source: AGHT+IGbtOy4w+1cloV0qO4AGi/KLkiNot8HTGWF8KQup3WtGyUq7bBU7Mc1r5U+SJNtEohjZVvE4Q== X-Received: by 2002:a05:6512:1284:b0:503:26bc:b08f with SMTP id u4-20020a056512128400b0050326bcb08fmr2927198lfs.24.1699471623287; Wed, 08 Nov 2023 11:27:03 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id p2-20020adfce02000000b0032f9688ea48sm5596807wrn.10.2023.11.08.11.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:27:02 -0800 (PST) From: luca.boccassi@gmail.com To: Shihong Wang Cc: Peng Zhang , Chaoyong He , dpdk stable Subject: patch 'net/nfp: fix DMA error after abnormal exit' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:28 +0000 Message-Id: <20231108192535.922238-30-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/61bbbaea8c324384d2f9692af90c11a49293b4da Thanks. Luca Boccassi --- >From 61bbbaea8c324384d2f9692af90c11a49293b4da Mon Sep 17 00:00:00 2001 From: Shihong Wang Date: Thu, 2 Nov 2023 10:23:13 +0800 Subject: [PATCH] net/nfp: fix DMA error after abnormal exit [ upstream commit 9e442599802e788874110339901f4eeb8f0ecc3b ] When DPDK application exit abnormally, there might have DMA error, and which will cause the load of firmware failed. Fix this by force the physical port down to clear the possible DMA error. Fixes: 896c265ef954 ("net/nfp: use new CPP interface") Signed-off-by: Shihong Wang Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index b60457b9bd..4b890e3375 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -3662,6 +3662,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, int ret = -ENODEV; int err; int i; + uint32_t j; if (!dev) return ret; @@ -3696,6 +3697,10 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, return -EIO; } + /* Force the physical port down to clear the possible DMA error */ + for (j = 0; j < nfp_eth_table->count; j++) + nfp_eth_set_configured(cpp, nfp_eth_table->ports[j].index, 0); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { if (nfp_fw_setup(dev, cpp, nfp_eth_table, hwinfo)) { PMD_DRV_LOG(INFO, "Error when uploading firmware"); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:53.414114389 +0000 +++ 0030-net-nfp-fix-DMA-error-after-abnormal-exit.patch 2023-11-08 19:23:51.817397203 +0000 @@ -1 +1 @@ -From 9e442599802e788874110339901f4eeb8f0ecc3b Mon Sep 17 00:00:00 2001 +From 61bbbaea8c324384d2f9692af90c11a49293b4da Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9e442599802e788874110339901f4eeb8f0ecc3b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ - drivers/net/nfp/nfp_ethdev.c | 5 +++++ + drivers/net/nfp/nfp_net.c | 5 +++++ @@ -21,14 +22,14 @@ -diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c -index d4cc6ca64a..e988bcf5ac 100644 ---- a/drivers/net/nfp/nfp_ethdev.c -+++ b/drivers/net/nfp/nfp_ethdev.c -@@ -849,6 +849,7 @@ app_cleanup: - static int - nfp_pf_init(struct rte_pci_device *pci_dev) - { -+ uint32_t i; - int ret = 0; - uint64_t addr; - uint32_t cpp_id; -@@ -907,6 +908,10 @@ nfp_pf_init(struct rte_pci_device *pci_dev) - goto hwinfo_cleanup; +diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c +index b60457b9bd..4b890e3375 100644 +--- a/drivers/net/nfp/nfp_net.c ++++ b/drivers/net/nfp/nfp_net.c +@@ -3662,6 +3662,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + int ret = -ENODEV; + int err; + int i; ++ uint32_t j; + + if (!dev) + return ret; +@@ -3696,6 +3697,10 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + return -EIO; @@ -38,2 +39,2 @@ -+ for (i = 0; i < nfp_eth_table->count; i++) -+ nfp_eth_set_configured(cpp, nfp_eth_table->ports[i].index, 0); ++ for (j = 0; j < nfp_eth_table->count; j++) ++ nfp_eth_set_configured(cpp, nfp_eth_table->ports[j].index, 0); @@ -41,3 +42,3 @@ - if (nfp_fw_setup(pci_dev, cpp, nfp_eth_table, hwinfo) != 0) { - PMD_INIT_LOG(ERR, "Error when uploading firmware"); - ret = -EIO; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + if (nfp_fw_setup(dev, cpp, nfp_eth_table, hwinfo)) { + PMD_DRV_LOG(INFO, "Error when uploading firmware");