DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnx2x: release port upon close
@ 2020-09-27 22:36 Rasesh Mody
  2020-09-27 22:36 ` [dpdk-dev] [PATCH] net/qede: " Rasesh Mody
  2020-09-29 18:20 ` [dpdk-dev] [PATCH] net/bnx2x: " Jerin Jacob
  0 siblings, 2 replies; 4+ messages in thread
From: Rasesh Mody @ 2020-09-27 22:36 UTC (permalink / raw)
  To: thomas, ferruh.yigit, jerinjacobk
  Cc: dev, irusskikh, dsinghrawat, Rasesh Mody

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
for the port can be freed by rte_eth_dev_close(). With this change the
private port resources are released in the .dev_close callback.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index b2ea5fafa..d0268fcd5 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -287,6 +287,10 @@ bnx2x_dev_close(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE(sc);
 
+	/* only close in case of the primary process */
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return;
+
 	if (IS_VF(sc))
 		bnx2x_vf_close(sc);
 
@@ -295,6 +299,9 @@ bnx2x_dev_close(struct rte_eth_dev *dev)
 
 	/* free ilt */
 	bnx2x_free_ilt_mem(sc);
+
+	/* mac_addrs must not be freed alone because part of dev_private */
+	dev->data->mac_addrs = NULL;
 }
 
 static int
@@ -726,6 +733,11 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 			goto out;
 	}
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	return 0;
 
 out:
@@ -753,8 +765,9 @@ eth_bnx2xvf_dev_init(struct rte_eth_dev *eth_dev)
 
 static int eth_bnx2x_dev_uninit(struct rte_eth_dev *eth_dev)
 {
-	/* mac_addrs must not be freed alone because part of dev_private */
-	eth_dev->data->mac_addrs = NULL;
+	struct bnx2x_softc *sc = eth_dev->data->dev_private;
+	PMD_INIT_FUNC_TRACE(sc);
+	bnx2x_dev_close(eth_dev);
 	return 0;
 }
 
-- 
2.18.1


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

* [dpdk-dev] [PATCH] net/qede: release port upon close
  2020-09-27 22:36 [dpdk-dev] [PATCH] net/bnx2x: release port upon close Rasesh Mody
@ 2020-09-27 22:36 ` Rasesh Mody
  2020-09-29 18:20 ` [dpdk-dev] [PATCH] net/bnx2x: " Jerin Jacob
  1 sibling, 0 replies; 4+ messages in thread
From: Rasesh Mody @ 2020-09-27 22:36 UTC (permalink / raw)
  To: thomas, ferruh.yigit, jerinjacobk
  Cc: dev, irusskikh, dsinghrawat, Rasesh Mody

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
for the port can be freed by rte_eth_dev_close(). With this change the
private port resources are released in the .dev_close callback.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 59f1746ee..b9e28a671 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1550,6 +1550,10 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	/* only close in case of the primary process */
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return;
+
 	/* dev_stop() shall cleanup fp resources in hw but without releasing
 	 * dma memories and sw structures so that dev_start() can be called
 	 * by the app without reconfiguration. However, in dev_close() we
@@ -1586,6 +1590,10 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 
 	if (ECORE_IS_CMT(edev))
 		rte_eal_alarm_cancel(qede_poll_sp_sb_cb, (void *)eth_dev);
+
+	eth_dev->dev_ops = NULL;
+	eth_dev->rx_pkt_burst = NULL;
+	eth_dev->tx_pkt_burst = NULL;
 }
 
 static int
@@ -2701,6 +2709,11 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 		adapter->ipgre.enable = false;
 	}
 
+	/* Pass the information to the rte_eth_dev_close() that it should also
+	 * release the private port resources.
+	 */
+	eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
 	DP_INFO(edev, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n",
 		adapter->primary_mac.addr_bytes[0],
 		adapter->primary_mac.addr_bytes[1],
@@ -2735,20 +2748,8 @@ static int qede_dev_common_uninit(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
-
 	PMD_INIT_FUNC_TRACE(edev);
-
-	/* only uninitialize in the primary process */
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return 0;
-
-	/* safe to close dev here */
 	qede_dev_close(eth_dev);
-
-	eth_dev->dev_ops = NULL;
-	eth_dev->rx_pkt_burst = NULL;
-	eth_dev->tx_pkt_burst = NULL;
-
 	return 0;
 }
 
-- 
2.18.1


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

* Re: [dpdk-dev] [PATCH] net/bnx2x: release port upon close
  2020-09-27 22:36 [dpdk-dev] [PATCH] net/bnx2x: release port upon close Rasesh Mody
  2020-09-27 22:36 ` [dpdk-dev] [PATCH] net/qede: " Rasesh Mody
@ 2020-09-29 18:20 ` Jerin Jacob
  2020-09-30  8:28   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Jerin Jacob @ 2020-09-29 18:20 UTC (permalink / raw)
  To: Rasesh Mody, Akhil Goyal, Anoob Joseph
  Cc: Thomas Monjalon, Ferruh Yigit, dpdk-dev, Igor Russkikh,
	Devendra Singh Rawat

On Mon, Sep 28, 2020 at 4:07 AM Rasesh Mody <rmody@marvell.com> wrote:
>
> Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
> for the port can be freed by rte_eth_dev_close(). With this change the
> private port resources are released in the .dev_close callback.
>
> Signed-off-by: Rasesh Mody <rmody@marvell.com>


It looks like it has ICC compiler errors in this patch[1]. I don't
think, it is introduced by this patch. It is from CPT crypto driver.

[1]
http://mails.dpdk.org/archives/test-report/2020-September/155058.html

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

* Re: [dpdk-dev] [PATCH] net/bnx2x: release port upon close
  2020-09-29 18:20 ` [dpdk-dev] [PATCH] net/bnx2x: " Jerin Jacob
@ 2020-09-30  8:28   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-09-30  8:28 UTC (permalink / raw)
  To: Jerin Jacob, Rasesh Mody, Akhil Goyal, Anoob Joseph
  Cc: Thomas Monjalon, dpdk-dev, Igor Russkikh, Devendra Singh Rawat

On 9/29/2020 7:20 PM, Jerin Jacob wrote:
> On Mon, Sep 28, 2020 at 4:07 AM Rasesh Mody <rmody@marvell.com> wrote:
>>
>> Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
>> for the port can be freed by rte_eth_dev_close(). With this change the
>> private port resources are released in the .dev_close callback.
>>
>> Signed-off-by: Rasesh Mody <rmody@marvell.com>
> 
> 
> It looks like it has ICC compiler errors in this patch[1]. I don't
> think, it is introduced by this patch. It is from CPT crypto driver.
> 
> [1]
> http://mails.dpdk.org/archives/test-report/2020-September/155058.html
> 

These patches seems pulled to the Thomas' "cleanup ethdev close operation" patchset:
[v3,17/29] net/qede: release port upon close (https://patches.dpdk.org/patch/79083/)
[v3,06/29] net/bnx2x: release port upon close 
(https://patches.dpdk.org/patch/79072/)

Can you please review the patches in that patchset? And they can be merged with 
the whole patchset.
I will mark this set as superseded.


Btw, agree that compile error looks unrelated.

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

end of thread, other threads:[~2020-09-30  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27 22:36 [dpdk-dev] [PATCH] net/bnx2x: release port upon close Rasesh Mody
2020-09-27 22:36 ` [dpdk-dev] [PATCH] net/qede: " Rasesh Mody
2020-09-29 18:20 ` [dpdk-dev] [PATCH] net/bnx2x: " Jerin Jacob
2020-09-30  8:28   ` Ferruh Yigit

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).