[v5,21/42] bus/fslmc: introduce VFIO DMA mapping API for fslmc

Message ID 20241023115955.1207617-22-vanshika.shukla@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series DPAA2 specific patches |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Vanshika Shukla Oct. 23, 2024, 11:59 a.m. UTC
From: Jun Yang <jun.yang@nxp.com>

Declare rte_fslmc_vfio_mem_dmamap and rte_fslmc_vfio_mem_dmaunmap
in bus_fslmc_driver.h for external usage.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/bus/fslmc/bus_fslmc_driver.h     | 7 ++++++-
 drivers/bus/fslmc/fslmc_bus.c            | 2 +-
 drivers/bus/fslmc/fslmc_vfio.c           | 3 ++-
 drivers/bus/fslmc/fslmc_vfio.h           | 7 +------
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
 5 files changed, 11 insertions(+), 10 deletions(-)
  

Patch

diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h
index 777ab24c10..1d4ce4785f 100644
--- a/drivers/bus/fslmc/bus_fslmc_driver.h
+++ b/drivers/bus/fslmc/bus_fslmc_driver.h
@@ -1,6 +1,6 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- *   Copyright 2016,2021 NXP
+ *   Copyright 2016,2021-2023 NXP
  *
  */
 
@@ -135,6 +135,11 @@  struct rte_dpaa2_object {
 	rte_dpaa2_obj_close_t close;
 };
 
+int
+rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size);
+int
+rte_fslmc_vfio_mem_dmaunmap(uint64_t iova, uint64_t size);
+
 /**
  * A structure describing a DPAA2 driver.
  */
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 107cc70833..fda0a4206d 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -438,7 +438,7 @@  rte_fslmc_probe(void)
 	 * install callback handler.
 	 */
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		ret = rte_fslmc_vfio_dmamap();
+		ret = fslmc_vfio_dmamap();
 		if (ret) {
 			DPAA2_BUS_ERR("Unable to DMA map existing VAs: (%d)",
 				      ret);
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 5b382d93e4..b9fa1a30b5 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -1154,7 +1154,8 @@  rte_fslmc_vfio_mem_dmaunmap(uint64_t iova, uint64_t size)
 	return fslmc_unmap_dma(0, iova, size);
 }
 
-int rte_fslmc_vfio_dmamap(void)
+int
+fslmc_vfio_dmamap(void)
 {
 	int i = 0, ret;
 
diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h
index 1695b6c078..815970ec38 100644
--- a/drivers/bus/fslmc/fslmc_vfio.h
+++ b/drivers/bus/fslmc/fslmc_vfio.h
@@ -60,10 +60,5 @@  int fslmc_vfio_process_group(void);
 int fslmc_vfio_close_group(void);
 char *fslmc_get_container(void);
 int fslmc_get_container_group(const char *group_name, int *gropuid);
-int rte_fslmc_vfio_dmamap(void);
-int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova,
-		uint64_t size);
-int rte_fslmc_vfio_mem_dmaunmap(uint64_t iova,
-		uint64_t size);
-
+int fslmc_vfio_dmamap(void);
 #endif /* _FSLMC_VFIO_H_ */
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 886fb7fbb0..c054988513 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -23,7 +23,7 @@ 
 #include <dev_driver.h>
 #include "rte_dpaa2_mempool.h"
 
-#include "fslmc_vfio.h"
+#include <bus_fslmc_driver.h>
 #include <fslmc_logs.h>
 #include <mc/fsl_dpbp.h>
 #include <portal/dpaa2_hw_pvt.h>