[v1,4/4] net/enetc: release port upon close

Message ID 20200928085713.13560-5-sachin.saxena@oss.nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Align device close operation with new behavior |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Sachin Saxena (OSS) Sept. 28, 2020, 8:57 a.m. UTC
  From: Sachin Saxena <sachin.saxena@oss.nxp.com>

With removal of old close behavior, the private
port resources must be released in the .dev_close callback.
Freeing of port private resources is moved from
the ".remove(device)" to the ".dev_close(port)" operation

Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
---
 drivers/net/enetc/enetc_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index d42add3ef..b3dec7e64 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -568,6 +568,9 @@  enetc_dev_close(struct rte_eth_dev *dev)
 	}
 	dev->data->nb_tx_queues = 0;
 
+	if (rte_eal_iova_mode() == RTE_IOVA_PA)
+		dpaax_iova_table_depopulate();
+
 	return 0;
 }
 
@@ -919,14 +922,11 @@  enetc_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static int
-enetc_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused)
+enetc_dev_uninit(struct rte_eth_dev *eth_dev)
 {
 	PMD_INIT_FUNC_TRACE();
 
-	if (rte_eal_iova_mode() == RTE_IOVA_PA)
-		dpaax_iova_table_depopulate();
-
-	return 0;
+	return enetc_dev_close(eth_dev);
 }
 
 static int