From patchwork Fri Sep 13 05:59:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vanshika Shukla X-Patchwork-Id: 144026 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F02045977; Fri, 13 Sep 2024 08:03:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A5B242EE1; Fri, 13 Sep 2024 08:00:38 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 67FFE42DE9 for ; Fri, 13 Sep 2024 08:00:11 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2AC6E2002E1; Fri, 13 Sep 2024 08:00:11 +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 AF3BB200345; Fri, 13 Sep 2024 08:00:10 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id F28D8183DC02; Fri, 13 Sep 2024 14:00:09 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v1 22/43] bus/fslmc: introduce VFIO DMA mapping API for fslmc Date: Fri, 13 Sep 2024 11:29:38 +0530 Message-Id: <20240913055959.3246917-23-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240913055959.3246917-1-vanshika.shukla@nxp.com> References: <20240913055959.3246917-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 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 From: Jun Yang 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 --- 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(-) diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h index 462bf2113e..7479fd35e0 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 ce87b4ddbd..6590b2305f 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 bcdca909ee..bd8455b70d 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -1160,7 +1160,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 408b35680d..11efcc036e 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -64,10 +64,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 42e17d984c..cfa71751d8 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -23,7 +23,7 @@ #include #include "rte_dpaa2_mempool.h" -#include "fslmc_vfio.h" +#include #include #include #include