From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02C35C5DF81 for ; Thu, 20 Aug 2026 14:44:21 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82AFA40E03; Thu, 20 Aug 2026 16:43:36 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 0625D40DCE for ; Thu, 20 Aug 2026 16:43:31 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DAAC12001C7; Thu, 20 Aug 2026 16:43:30 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A54122001CB; Thu, 20 Aug 2026 16:43:30 +0200 (CEST) Received: from lsv03583.swis.in-blr01.nxp.com (lsv03583.swis.in-blr01.nxp.com [92.120.146.12]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 4D09518000B0; Thu, 20 Aug 2026 22:43:29 +0800 (+08) From: Hemant Agrawal To: stephen@networkplumber.org, thomas@monjalon.net, dev@dpdk.org Subject: [PATCH v14 11/23] net/dpaa: optimize FM deconfig Date: Thu, 20 Aug 2026 20:13:00 +0530 Message-Id: <20260820144312.3922316-12-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260820144312.3922316-1-hemant.agrawal@nxp.com> References: <20260819105004.2272880-1-hemant.agrawal@nxp.com> <20260820144312.3922316-1-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- drivers/net/dpaa/dpaa_ethdev.c | 42 +++++++++++++++------------------- drivers/net/dpaa/dpaa_flow.c | 9 ++++---- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 2f31ff5150..7aa1887f98 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -567,15 +567,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev) return -ENOENT; } - /* 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); - } - } - dpaa_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *dpaa_dev); intr_handle = dpaa_dev->intr_handle; __fif = container_of(fif, struct __fman_if, __if); @@ -616,7 +607,26 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev) clean_1: /* release configuration memory */ 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) { for (loop = 0; loop < dpaa_intf->nb_rx_queues; loop++) { @@ -667,20 +677,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev) rte_free(dpaa_intf->tx_queues); dpaa_intf->tx_queues = NULL; - if (dpaa_intf->port_handle) { - ret = dpaa_fm_deconfig(dpaa_intf, fif); - 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); - } - } rte_free(dpaa_intf->tx_conf_queues); dpaa_intf->tx_conf_queues = NULL; diff --git a/drivers/net/dpaa/dpaa_flow.c b/drivers/net/dpaa/dpaa_flow.c index f21950f64d..bfe294d21d 100644 --- a/drivers/net/dpaa/dpaa_flow.c +++ b/drivers/net/dpaa/dpaa_flow.c @@ -728,6 +728,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) { @@ -787,10 +790,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