DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/net: release port upon close
@ 2019-08-27  5:01 chenxux.di
  2019-08-27  6:23 ` Ye Xiaolong
                   ` (5 more replies)
  0 siblings, 6 replies; 38+ messages in thread
From: chenxux.di @ 2019-08-27  5:01 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, Beilei Xing, Qi Zhang, Yang Qiming, Di ChenxuX

From: Di ChenxuX <chenxux.di@intel.com>

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private
resources for the port can be freed by rte_eth_dev_close().
This patch cover all the intel drivers

Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
---
 drivers/net/e1000/igb_ethdev.c   | 5 +++++
 drivers/net/fm10k/fm10k_ethdev.c | 5 +++++
 drivers/net/i40e/i40e_ethdev.c   | 5 +++++
 drivers/net/ice/ice_ethdev.c     | 5 +++++
 drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
 5 files changed, 25 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index fec2b4289..fe785d1d7 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -843,6 +843,11 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
 			&eth_dev->data->mac_addrs[0]);
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	/* initialize the vfta */
 	memset(shadow_vfta, 0, sizeof(*shadow_vfta));
 
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..b5a427c7b 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3103,6 +3103,11 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 		&dev->data->mac_addrs[0]);
 	}
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	/* Reset the hw statistics */
 	fm10k_stats_reset(dev);
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..a0536f14c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1520,6 +1520,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr,
 					&dev->data->mac_addrs[0]);
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	/* Init dcb to sw mode by default */
 	ret = i40e_dcb_init_configure(dev, TRUE);
 	if (ret != I40E_SUCCESS) {
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 44a14cb8a..476c768ee 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1488,6 +1488,11 @@ ice_dev_init(struct rte_eth_dev *dev)
 		goto err_init_mac;
 	}
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	ret = ice_res_pool_init(&pf->msix_pool, 1,
 				hw->func_caps.common_cap.num_msix_vectors - 1);
 	if (ret) {
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 03fc1f717..3e2b537ec 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1245,6 +1245,11 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 		return -ENOMEM;
 	}
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	/* initialize the vfta */
 	memset(shadow_vfta, 0, sizeof(*shadow_vfta));
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2019-09-27 10:53 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27  5:01 [dpdk-dev] [PATCH] drivers/net: release port upon close chenxux.di
2019-08-27  6:23 ` Ye Xiaolong
2019-09-05 11:03 ` [dpdk-dev] [PATCH v3 0/5] " Di ChenxuX
2019-09-05 11:03   ` [dpdk-dev] [PATCH v3 1/5] net/e1000: " Di ChenxuX
2019-09-05 11:03   ` [dpdk-dev] [PATCH v3 2/5] net/fm10k: " Di ChenxuX
2019-09-05 11:03   ` [dpdk-dev] [PATCH v3 3/5] net/i40e: " Di ChenxuX
2019-09-05 11:03   ` [dpdk-dev] [PATCH v3 4/5] net/ice: " Di ChenxuX
2019-09-05 11:03   ` [dpdk-dev] [PATCH v3 5/5] net/ixgbe: " Di ChenxuX
2019-09-19  2:47 ` [dpdk-dev] [PATCH v4 0/5] drivers/net: " Di ChenxuX
2019-09-19  2:47   ` [dpdk-dev] [PATCH v4 1/5] net/e1000: " Di ChenxuX
2019-09-25 15:41     ` Ye Xiaolong
2019-09-26  3:21       ` Di, ChenxuX
2019-09-19  2:47   ` [dpdk-dev] [PATCH v4 2/5] net/fm10k: " Di ChenxuX
2019-09-19  2:47   ` [dpdk-dev] [PATCH v4 3/5] net/i40e: " Di ChenxuX
2019-09-19  2:47   ` [dpdk-dev] [PATCH v4 4/5] net/ice: " Di ChenxuX
2019-09-19  2:47   ` [dpdk-dev] [PATCH v4 5/5] net/ixgbe: " Di ChenxuX
2019-09-23  2:27   ` [dpdk-dev] [PATCH v4 0/5] drivers/net: " Yang, Qiming
2019-09-26  7:30 ` [dpdk-dev] [PATCH v5 " Di ChenxuX
2019-09-26  7:30   ` [dpdk-dev] [PATCH v5 1/5] net/e1000: " Di ChenxuX
2019-09-26  7:30   ` [dpdk-dev] [PATCH v5 2/5] net/fm10k: " Di ChenxuX
2019-09-26  7:30   ` [dpdk-dev] [PATCH v5 3/5] net/i40e: " Di ChenxuX
2019-09-26  7:30   ` [dpdk-dev] [PATCH v5 4/5] net/ice: " Di ChenxuX
2019-09-26  7:30   ` [dpdk-dev] [PATCH v5 5/5] net/ixgbe: " Di ChenxuX
2019-09-26 10:42   ` [dpdk-dev] [PATCH v5 0/5] drivers/net: " Ye Xiaolong
2019-09-26 10:00 ` [dpdk-dev] [PATCH v6 " Di ChenxuX
2019-09-26 10:00   ` [dpdk-dev] [PATCH v6 1/5] net/e1000: " Di ChenxuX
2019-09-26 10:00   ` [dpdk-dev] [PATCH v6 2/5] net/fm10k: " Di ChenxuX
2019-09-26 10:00   ` [dpdk-dev] [PATCH v6 3/5] net/i40e: " Di ChenxuX
2019-09-26 10:00   ` [dpdk-dev] [PATCH v6 4/5] net/ice: " Di ChenxuX
2019-09-26 10:00   ` [dpdk-dev] [PATCH v6 5/5] net/ixgbe: " Di ChenxuX
2019-09-27  2:46   ` [dpdk-dev] [PATCH v6 0/5] drivers/net: " Yang, Qiming
2019-09-27  9:09 ` [dpdk-dev] [PATCH v7 " Di ChenxuX
2019-09-27  9:09   ` [dpdk-dev] [PATCH v7 1/5] net/e1000: " Di ChenxuX
2019-09-27  9:09   ` [dpdk-dev] [PATCH v7 2/5] net/fm10k: " Di ChenxuX
2019-09-27  9:09   ` [dpdk-dev] [PATCH v7 3/5] net/i40e: " Di ChenxuX
2019-09-27  9:09   ` [dpdk-dev] [PATCH v7 4/5] net/ice: " Di ChenxuX
2019-09-27  9:09   ` [dpdk-dev] [PATCH v7 5/5] net/ixgbe: " Di ChenxuX
2019-09-27 10:50   ` [dpdk-dev] [PATCH v7 0/5] drivers/net: " Ye Xiaolong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).