patch 'net/ionic: fix device close' has been queued to stable release 21.11.7

Kevin Traynor ktraynor at redhat.com
Tue Mar 5 16:34:26 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.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 03/11/24. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/3b7cc646a988ea82e94d4a00091ac74a1ad4c66f

Thanks.

Kevin

---
>From 3b7cc646a988ea82e94d4a00091ac74a1ad4c66f Mon Sep 17 00:00:00 2001
From: Andrew Boyer <andrew.boyer at amd.com>
Date: Tue, 6 Feb 2024 19:13:14 -0800
Subject: [PATCH] net/ionic: fix device close

[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ]

The close routine should release all resources, but not
call rte_eth_dev_destroy(). As written this code will call
rte_eth_dev_release_port() twice and segfault.

Instead, move rte_eth_dev_destroy() to the remove routine.
eth_ionic_dev_uninit() will call close if necessary.

Fixes: 175e4e7ed760 ("net/ionic: complete release on close")

Signed-off-by: Andrew Boyer <andrew.boyer at amd.com>
---
 drivers/net/ionic/ionic_ethdev.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 31fe23ef34..8a2b105238 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -953,14 +953,15 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
 	ionic_lif_stop(lif);
 
-	ionic_lif_free_queues(lif);
-
 	IONIC_PRINT(NOTICE, "Removing device %s", eth_dev->device->name);
 	ionic_unconfigure_intr(adapter);
 
-	rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit);
-
 	ionic_port_reset(adapter);
 	ionic_reset(adapter);
 
+	ionic_lif_free_queues(lif);
+	ionic_lif_deinit(lif);
+	ionic_lif_free(lif); /* Does not free LIF object */
+
+	lif->adapter = NULL;
 	rte_free(adapter);
 
@@ -1039,7 +1040,4 @@ static int
 eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
 {
-	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
-	struct ionic_adapter *adapter = lif->adapter;
-
 	IONIC_PRINT_CALL();
 
@@ -1047,11 +1045,11 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
 		return 0;
 
-	adapter->lif = NULL;
+	if (eth_dev->state != RTE_ETH_DEV_UNUSED)
+		ionic_dev_close(eth_dev);
 
-	ionic_lif_deinit(lif);
-	ionic_lif_free(lif);
-
-	if (!(lif->state & IONIC_LIF_F_FW_RESET))
-		ionic_lif_reset(lif);
+	eth_dev->dev_ops = NULL;
+	eth_dev->rx_pkt_burst = NULL;
+	eth_dev->tx_pkt_burst = NULL;
+	eth_dev->tx_pkt_prepare = NULL;
 
 	return 0;
@@ -1258,4 +1256,5 @@ eth_ionic_pci_remove(struct rte_pci_device *pci_dev)
 	char name[RTE_ETH_NAME_MAX_LEN];
 	struct rte_eth_dev *eth_dev;
+	int ret = 0;
 
 	/* Adapter lookup is using the eth_dev name */
@@ -1264,10 +1263,10 @@ eth_ionic_pci_remove(struct rte_pci_device *pci_dev)
 	eth_dev = rte_eth_dev_allocated(name);
 	if (eth_dev)
-		ionic_dev_close(eth_dev);
+		ret = rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit);
 	else
 		IONIC_PRINT(DEBUG, "Cannot find device %s",
 			pci_dev->device.name);
 
-	return 0;
+	return ret;
 }
 
-- 
2.43.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 14:08:55.911671690 +0000
+++ 0053-net-ionic-fix-device-close.patch	2024-03-05 14:08:54.692520876 +0000
@@ -1 +1 @@
-From 73028be3b4d4d52f5d73becfd22bff3f57a81252 Mon Sep 17 00:00:00 2001
+From 3b7cc646a988ea82e94d4a00091ac74a1ad4c66f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +19,2 @@
- drivers/net/ionic/ionic_ethdev.c | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
+ drivers/net/ionic/ionic_ethdev.c | 29 ++++++++++++++---------------
+ 1 file changed, 14 insertions(+), 15 deletions(-)
@@ -22 +23 @@
-index 7c55a26956..bedcf958e2 100644
+index 31fe23ef34..8a2b105238 100644
@@ -25 +26 @@
-@@ -1010,17 +1010,19 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
+@@ -953,14 +953,15 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
@@ -31,2 +32 @@
- 	if (adapter->intf->unconfigure_intr)
- 		(*adapter->intf->unconfigure_intr)(adapter);
+ 	ionic_unconfigure_intr(adapter);
@@ -38 +38 @@
-+
+ 
@@ -43,3 +42,0 @@
- 	if (adapter->intf->unmap_bars)
- 		(*adapter->intf->unmap_bars)(adapter);
- 
@@ -49 +46 @@
-@@ -1099,7 +1101,4 @@ static int
+@@ -1039,7 +1040,4 @@ static int
@@ -57 +54 @@
-@@ -1107,11 +1106,11 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
+@@ -1047,11 +1045,11 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
@@ -75 +72 @@
-@@ -1268,4 +1267,5 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
+@@ -1258,4 +1256,5 @@ eth_ionic_pci_remove(struct rte_pci_device *pci_dev)
@@ -81 +78 @@
-@@ -1274,9 +1274,9 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
+@@ -1264,10 +1263,10 @@ eth_ionic_pci_remove(struct rte_pci_device *pci_dev)
@@ -87 +84,2 @@
- 		IONIC_PRINT(DEBUG, "Cannot find device %s", rte_dev->name);
+ 		IONIC_PRINT(DEBUG, "Cannot find device %s",
+ 			pci_dev->device.name);



More information about the stable mailing list