patch 'net/nfp: fix DMA error after abnormal exit' has been queued to stable release 20.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 8 20:25:28 CET 2023


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 <shihong.wang at corigine.com>
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 <shihong.wang at corigine.com>
Signed-off-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
---
 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 at 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");


More information about the stable mailing list