DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: stephen@networkplumber.org, david.marchand@redhat.com, dev@dpdk.org
Subject: [PATCH v6 12/19] net/dpaa: optimize FM deconfig
Date: Thu,  2 Jul 2026 11:03:52 +0530	[thread overview]
Message-ID: <20260702053359.3243907-13-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20260702053359.3243907-1-hemant.agrawal@nxp.com>

Consolidate FM deconfiguration to avoid duplicate calls.
Move the fm_deconfig call to a single location and remove
redundant checks in the device close path.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 27 +++++++++++++++++++++++----
 drivers/net/dpaa/dpaa_flow.c   |  9 +++++----
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 9beced37a0..20c198406b 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -528,10 +528,12 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 
 	/* DPAA FM deconfig */
 	if (!(default_q || fmc_q)) {
-		ret = dpaa_fm_deconfig(dpaa_intf, dev->process_private);
-		if (ret) {
-			DPAA_PMD_WARN("%s: FM deconfig failed(%d)",
-				dev->data->name, ret);
+		if (dpaa_intf->port_handle) {
+			ret = dpaa_fm_deconfig(dpaa_intf, dev->process_private);
+			if (ret) {
+				DPAA_PMD_WARN("%s: FM deconfig failed(%d)",
+					dev->data->name, ret);
+			}
 		}
 	}
 
@@ -577,6 +579,23 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	rte_free(dpaa_intf->fc_conf);
 	dpaa_intf->fc_conf = NULL;
 
+	/** For FMCLESS mode of share MAC, deconfig FM to direct
+	 * ingress traffic to kernel before fq shutdown.
+	 */
+	if (!(default_q || fmc_q) && dpaa_intf->port_handle) {
+		ret = dpaa_fm_deconfig(dpaa_intf, dev->process_private);
+		if (ret) {
+			DPAA_PMD_WARN("%s: FM deconfig failed(%d)",
+				dev->data->name, ret);
+		}
+	}
+	if (fif->num_profiles) {
+		ret = dpaa_port_vsp_cleanup(dpaa_intf, fif);
+		if (ret) {
+			DPAA_PMD_WARN("%s: cleanup VSP failed(%d)",
+				dev->data->name, ret);
+		}
+	}
 	/** Release congestion Groups after releasing FQIDs*/
 	/* Release RX congestion Groups */
 	if (dpaa_intf->cgr_rx) {
diff --git a/drivers/net/dpaa/dpaa_flow.c b/drivers/net/dpaa/dpaa_flow.c
index 417b9b6fbb..559850ced7 100644
--- a/drivers/net/dpaa/dpaa_flow.c
+++ b/drivers/net/dpaa/dpaa_flow.c
@@ -724,6 +724,9 @@ int dpaa_fm_deconfig(struct dpaa_if *dpaa_intf,
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!dpaa_intf->port_handle)
+		return 0;
+
 	/* FM PORT Disable */
 	ret = fm_port_disable(dpaa_intf->port_handle);
 	if (ret != E_OK) {
@@ -783,10 +786,8 @@ int dpaa_fm_config(struct rte_eth_dev *dev, uint64_t req_dist_set)
 	unsigned int i = 0;
 	PMD_INIT_FUNC_TRACE();
 
-	if (dpaa_intf->port_handle) {
-		if (dpaa_fm_deconfig(dpaa_intf, fif))
-			DPAA_PMD_ERR("DPAA FM deconfig failed");
-	}
+	if (dpaa_fm_deconfig(dpaa_intf, fif))
+		DPAA_PMD_ERR("DPAA FM deconfig failed");
 
 	if (!dev->data->nb_rx_queues)
 		return 0;
-- 
2.25.1


  parent reply	other threads:[~2026-07-02  5:35 UTC|newest]

Thread overview: 147+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 12:28 [PATCH 00/18] NXP DPAA enhancements Hemant Agrawal
2026-06-19 12:28 ` [PATCH 01/18] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-06-19 12:28 ` [PATCH 02/18] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-06-19 12:29 ` [PATCH 03/18] net/dpaa: add BMI Tx statistics Hemant Agrawal
2026-06-19 12:29 ` [PATCH 04/18] dpaa: add process-type guards to prevent segfaults in secondary Hemant Agrawal
2026-06-19 12:29 ` [PATCH 05/18] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-06-19 12:29 ` [PATCH 06/18] bus/dpaa: shutdown FQ by fq descriptor Hemant Agrawal
2026-06-19 12:29 ` [PATCH 06/18] drivers: shutdown DPAA " Hemant Agrawal
2026-06-19 12:29 ` [PATCH 07/18] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-06-19 12:29 ` [PATCH 08/18] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-06-19 12:29 ` [PATCH 09/18] bus/dpaa: add cgrid cleanup support Hemant Agrawal
2026-06-19 12:29 ` [PATCH 09/18] drivers: add DPAA " Hemant Agrawal
2026-06-19 12:29 ` [PATCH 10/18] net/dpaa: clean tx_conf_fq on device stop Hemant Agrawal
2026-06-19 12:29 ` [PATCH 10/18] net/dpaa: clean Tx confirmation FQ " Hemant Agrawal
2026-06-19 12:29 ` [PATCH 11/18] net/dpaa: remove redundant FQ shutdown from rx_queue_setup Hemant Agrawal
2026-06-19 12:29 ` [PATCH 11/18] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-06-19 12:29 ` [PATCH 12/18] net/dpaa: optimize fm_deconfig Hemant Agrawal
2026-06-19 12:29 ` [PATCH 12/18] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-06-19 12:29 ` [PATCH 13/18] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-06-19 12:29 ` [PATCH 14/18] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-06-19 12:29 ` [PATCH 15/18] net/dpaa: report error on using deferred start Hemant Agrawal
2026-06-19 12:29 ` [PATCH 16/18] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-06-19 12:29 ` [PATCH 16/18] mempool/dpaa: optimize " Hemant Agrawal
2026-06-19 12:29 ` [PATCH 17/18] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-06-19 12:29 ` [PATCH 17/18] mempool/dpaa: release " Hemant Agrawal
2026-06-19 12:29 ` [PATCH 18/18] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-06-21 10:16 ` [PATCH v2 00/19] dpaa: bus, net, dma and mempool improvements Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 01/19] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 02/19] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 03/19] drivers: add BMI Tx statistics Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 04/19] drivers: add process-type guards for secondary process Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 05/19] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 06/19] drivers: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 07/19] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 08/19] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 09/19] drivers: add DPAA cgrid cleanup support Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 10/19] net/dpaa: clean Tx confirmation FQ on device stop Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 11/19] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 12/19] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 13/19] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 14/19] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 15/19] net/dpaa: report error on using deferred start Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 16/19] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 17/19] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 18/19] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-06-21 10:16   ` [PATCH v2 19/19] net/dpaa: add ONIC port checks Hemant Agrawal
2026-06-21 15:22   ` [PATCH v3 00/19] dpaa: bus, net, dma and mempool improvements Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 01/19] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 02/19] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 03/19] drivers: add BMI Tx statistics Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 05/19] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 06/19] drivers: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 07/19] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 08/19] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 09/19] drivers: add DPAA cgrid cleanup support Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 10/19] net/dpaa: clean Tx confirmation FQ on device stop Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 11/19] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 12/19] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 13/19] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 14/19] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 15/19] net/dpaa: report error on using deferred start Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 16/19] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 17/19] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 18/19] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-06-21 15:22     ` [PATCH v3 19/19] net/dpaa: add ONIC port checks Hemant Agrawal
2026-06-21 16:42     ` [PATCH v3 00/19] dpaa: bus, net, dma and mempool improvements Stephen Hemminger
2026-06-21 17:27     ` [PATCH v4 00/19] dpaa: driver stability and feature improvements Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 01/19] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 02/19] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 03/19] drivers: add BMI Tx statistics Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 04/19] drivers: add process-type guards for secondary process Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 05/19] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 06/19] drivers: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 07/19] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 08/19] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 09/19] drivers: add DPAA cgrid cleanup support Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 10/19] net/dpaa: clean Tx confirmation FQ on device stop Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 11/19] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 12/19] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 13/19] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 14/19] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 15/19] net/dpaa: report error on using deferred start Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 16/19] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 17/19] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 18/19] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-06-21 17:27       ` [PATCH v4 19/19] net/dpaa: add ONIC port checks Hemant Agrawal
2026-06-26  6:56       ` [PATCH v5 00/19] DPAA bus/net/mempool/DMA driver fixes and improvements Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 01/19] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 02/19] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 03/19] drivers: add BMI Tx statistics Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 04/19] drivers: add process-type guards for secondary process Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 05/19] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 06/19] drivers: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 07/19] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 08/19] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 09/19] drivers: add DPAA cgrid cleanup support Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 10/19] net/dpaa: clean Tx confirmation FQ on device stop Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 11/19] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 12/19] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 13/19] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 14/19] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 15/19] net/dpaa: report error on using deferred start Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 16/19] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 17/19] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-06-26 16:59           ` Stephen Hemminger
2026-07-02  5:34             ` Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 18/19] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-06-26  6:56         ` [PATCH v5 19/19] net/dpaa: add ONIC port checks Hemant Agrawal
2026-07-02  5:33         ` [PATCH v6 00/19] DPAA bus/net/mempool/DMA driver fixes and improvements Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 01/19] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 02/19] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 03/19] drivers: add BMI Tx statistics Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 04/19] drivers: add process-type guards for secondary process Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 05/19] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 06/19] drivers: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 07/19] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 08/19] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 09/19] drivers: add DPAA cgrid cleanup support Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 10/19] net/dpaa: clean Tx confirmation FQ on device stop Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 11/19] net/dpaa: remove redundant FQ shutdown from Rx queue setup Hemant Agrawal
2026-07-02  5:33           ` Hemant Agrawal [this message]
2026-07-02  5:33           ` [PATCH v6 13/19] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 14/19] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 15/19] net/dpaa: report error on using deferred start Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 16/19] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 17/19] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 18/19] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal
2026-07-02  5:33           ` [PATCH v6 19/19] net/dpaa: add ONIC port checks Hemant Agrawal
2026-07-02 16:32           ` [PATCH v6 00/19] DPAA bus/net/mempool/DMA driver fixes and improvements Stephen Hemminger
2026-07-03 12:50             ` Hemant Agrawal
2026-07-03 12:49           ` [PATCH v7 00/16] " Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 01/16] bus/dpaa: refine fman naming and fix global scope Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 02/16] bus/dpaa: scan max BPID from DTS Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 03/16] drivers: add process-type guards for secondary process Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 04/16] bus/dpaa: define helpers for qman channel and wq Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 05/16] bus/dpaa: shutdown DPAA FQ by fq descriptor Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 06/16] bus/dpaa: improve FQ shutdown with channel validation Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 07/16] bus/dpaa: enhance DPAA FQ shutdown Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 08/16] bus/dpaa: add DPAA cgrid cleanup support Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 09/16] net/dpaa: add ONIC port checks Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 10/16] drivers: add BMI Tx statistics Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 11/16] net/dpaa: optimize FM deconfig Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 12/16] bus/dpaa: improve log macro and fix bus detection Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 13/16] net/dpaa: optimize FMC MAC type parsing Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 14/16] drivers: optimize DPAA multi-entry buffer pool operations Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 15/16] drivers: release DPAA bpid on driver destructor Hemant Agrawal
2026-07-03 12:49             ` [PATCH v7 16/16] dma/dpaa: add SG data validation and ERR050757 fix Hemant Agrawal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260702053359.3243907-13-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox