DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Shreyansh Jain <shreyansh.jain@nxp.com>,
	Rohit Raj <rohit.raj@nxp.com>
Subject: [PATCH v1 06/11] bus/fslmc: fix DPIO portal mapping leak on close
Date: Thu, 26 Nov 2026 16:03:12 +0000	[thread overview]
Message-ID: <4b169dfd04dc9e25bca9e17e2fc689b610f65d5d.1795708917.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1795708917.git.anatoly.burakov@intel.com>

Currently, when a DPIO device is closed, or when a failed DPIO probe
tears down the devices already on the list, we release the device but
never unmap its QBMan software portal regions. This leaks two mappings
per device.

Fix it by unmapping the portal regions in both places.

Fixes: e55d0494ab98 ("bus/fslmc: support secondary process")
Fixes: 274fd921ff7f ("bus/fslmc: support close operation")
Cc: shreyansh.jain@nxp.com
Cc: rohit.raj@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 67740601e6b..e7d72eac368 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -489,6 +489,7 @@ dpaa2_close_dpio_device(int object_id)
 			rte_free(dpio_dev->dpio);
 		}
 		TAILQ_REMOVE(&dpio_dev_list, dpio_dev, next);
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
@@ -710,6 +711,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 				dpio_dev->token);
 			rte_free(dpio_dev->dpio);
 		}
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
-- 
2.52.0


  parent reply	other threads:[~2026-11-26 16:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 02/11] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 03/11] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 04/11] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 05/11] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
2026-11-26 16:03 ` Anatoly Burakov [this message]
2026-11-26 16:03 ` [PATCH v1 07/11] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 08/11] bus/pci: fix leaks on BAR " Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 09/11] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 10/11] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 11/11] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 01/13] interrupts: fix partial event list resize Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 02/13] interrupts: validate event list counts Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 03/13] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 04/13] bus/cdx: fix error check when enabling bus master Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 05/13] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 06/13] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 07/13] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 08/13] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 09/13] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 10/13] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 11/13] bus/pci: fix leaks on BAR " Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 12/13] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 13/13] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov

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=4b169dfd04dc9e25bca9e17e2fc689b610f65d5d.1795708917.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=rohit.raj@nxp.com \
    --cc=sachin.saxena@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    /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