patch 'net/ionic: fix device close' has been queued to stable release 23.11.1
Xueming Li
xuemingl at nvidia.com
Tue Mar 5 10:47:24 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.1
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/31/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1ce60b941d17ee06fec8c363f8e58a6db0616af0
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 008e50e0b9..4ec9598b8e 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -970,19 +970,21 @@ 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);
if (adapter->intf->unconfigure_intr)
(*adapter->intf->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 */
+
if (adapter->intf->unmap_bars)
(*adapter->intf->unmap_bars)(adapter);
+ lif->adapter = NULL;
rte_free(adapter);
return 0;
@@ -1059,21 +1061,18 @@ err:
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();
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- adapter->lif = NULL;
-
- ionic_lif_deinit(lif);
- ionic_lif_free(lif);
+ if (eth_dev->state != RTE_ETH_DEV_UNUSED)
+ ionic_dev_close(eth_dev);
- 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;
}
@@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_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 */
snprintf(name, sizeof(name), "%s_lif", rte_dev->name);
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", rte_dev->name);
- return 0;
+ return ret;
}
RTE_LOG_REGISTER_DEFAULT(ionic_logtype, NOTICE);
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-03-05 17:39:34.091610403 +0800
+++ 0103-net-ionic-fix-device-close.patch 2024-03-05 17:39:30.883566497 +0800
@@ -1 +1 @@
-From 73028be3b4d4d52f5d73becfd22bff3f57a81252 Mon Sep 17 00:00:00 2001
+From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 7c55a26956..bedcf958e2 100644
+index 008e50e0b9..4ec9598b8e 100644
@@ -25 +27 @@
-@@ -1009,19 +1009,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
+@@ -970,19 +970,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
@@ -51 +53 @@
-@@ -1098,21 +1100,18 @@ err:
+@@ -1059,21 +1061,18 @@ err:
@@ -79 +81 @@
-@@ -1267,17 +1266,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
+@@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
More information about the stable
mailing list