From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B3A145B40; Tue, 15 Oct 2024 09:15:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 671C340696; Tue, 15 Oct 2024 09:14:48 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by mails.dpdk.org (Postfix) with ESMTP id 9CAD240691 for ; Tue, 15 Oct 2024 09:14:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cls6vycfYzLPPbA1cFGWQaKLUnfaPY4wRHqA1JNHPH+1V4zJFIixGGKGGKSSvyovapaXUf+iILecEJDYRupupeiWXbkW82Qkdxjb3vUTI703b+pEWM0BMdvYfiQOAqW1FNnFkzZx347IyjjKzVtZQaO8BIJ3JNH21+02BPY1aRyNRkrcHwtSZx6lBKxaFglvLGSV9CaeqjDlMPyrry5xTCRrcOuG2ZdvnX7ndRpVqgx5PiS83z1OGaFC67abDC1/dJFyDCwf9JVQqQr1upk6ffqzgxMfL41CkxT9L30oZZJOjSIRJydjeKLw6xe3xVqJBjx91aCluNk4U0H+RHgEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7cKOac3aCF/OH9FO7LHMxLKWukudg2grbAVljskerAU=; b=XyN2xzq6YpffPSBAdNUvAYLRKiHZ+kNcQZXK/IwNDDaMmCuyZbB6gYsxySAW3PDq1lHgRGkNXWKg6QbfRheOyKBqfbm3hzz3RRggMLFFQ7yiP+qLV9S71hiQ5yOqX/k6qoHn23UplrTEcKWmVy6/EcYTAcnkVbS9XxMoMFo0ar/+fCAamQMBhDkHZQKRaItdC7k/GzSM4jVy5tQ4TwxWwRrOnDyZPmjidPHZvW6392/DYNqewf2Jf878T5SZGiChXa655Gpqt6Ylj9Xyyav6OPKUMt9uyqMJSD3R+cxbpU6tt878QUH2GNKd3q0VUg/iUJe6dQFkUdTBTwi7bcYCGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7cKOac3aCF/OH9FO7LHMxLKWukudg2grbAVljskerAU=; b=nCpQ9PH/31eZ3xPKkr1I7MffiJDS4URdKIe7Ahs1kNoXOvM1EcTOpMzA52WEDqU70cmOmUnLx1OcVzEzMbKw7w9lB6pgVXKRs4SszY36k/BaBxNvV3F6nhWJKDLS7EYklJZsBsKlb3IKTStV3/amt/CAKVVEcecrZboU9LXrl7zC1o9T+ctilFn+H2hGYwbYqZgptBS8M7Fh+RmIvEDtwmQUvPWTHaGRDkV/+nbNnhnWfTCrLDqQTKGmOjK9X7C9NJaCpuVeNIIEAhs4oRt9q8ffVgDj+B2I7bhpGUgaCXx5lhvyRTJcBCAj08srKfi8Izrw5VU0PG+pQ0Gu31amHA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM9PR04MB7522.eurprd04.prod.outlook.com (2603:10a6:20b:282::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.22; Tue, 15 Oct 2024 07:14:33 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8048.020; Tue, 15 Oct 2024 07:14:33 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v7 07/15] dma/dpaa2: move the qdma header to common place Date: Tue, 15 Oct 2024 12:43:55 +0530 Message-Id: <20241015071403.1940833-8-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241015071403.1940833-1-g.singh@nxp.com> References: <20241014093639.553467-1-g.singh@nxp.com> <20241015071403.1940833-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0058.apcprd02.prod.outlook.com (2603:1096:4:54::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM9PR04MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cd3702b-08ee-4dd9-6a58-08dcece904a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sA6mdSwcxHnNz6hq1vOzVLG+zcH4KeICx0sD7FQhq9nSb4Y8eIDwj3musGdd?= =?us-ascii?Q?q2kxQXqs8zdfmS0YRG+a0r2twkrGooiIYq0AGaL7PbdLz92qi1T1Mp+F6J1O?= =?us-ascii?Q?uQwsaEzOB7B/PfHqivCbYqLuDwnJfvOKSkBvedbweMsnYtNh1pXQ46MfAYDN?= =?us-ascii?Q?AELlobbhg/7BuEgWLbl8gyvtxtHDNejw/HXjugvu4Wob6eusWkgBr52Lutva?= =?us-ascii?Q?F7IbI2zw/v/n1EmZQVBx8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?0SZMqehhpUxQgim2qB+Bkwcm5tYoNeQuV69wL6/zgnUjwpf2m32oqr2N/wpR?= =?us-ascii?Q?UVZp14DTtObpU1SZpgJirWfjI45Bhuk9vQJWn4rh/DQsIdSOQDlCnlVs/Sr+?= =?us-ascii?Q?g4Yf+1BjvlV6Ue2UXJCcckL8gFKV5z4ogklWKlHW7jDmSPXZlfbttRyLbenA?= =?us-ascii?Q?DqTkGjUTGzLyziTYYFSKT7JAuy4sltwIi/J95KpVirQ+Hw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GvHDd8a3521hN7us3+NhOdEfrlve+cb9WiCD6u0MaWZrKHrdHQTZaQYmkeh/?= =?us-ascii?Q?QBcwVNPCS55MQOg/y8p6YlGxXmDYNqtqwZW+oK+qnJ3tdCzDd4hcSkA7dE2i?= =?us-ascii?Q?LPI/TnTqWMQq/uifm+zR0qbpWXFWPbJ+dWF4wE1Iue4sTWtD87NrgO1lKU1M?= =?us-ascii?Q?JSWDnowOkRKMqTGs2udoSk3IteEs9TWPeuOpaNBUnqNHCDQASLlx4VapJJiB?= =?us-ascii?Q?V+1edlnXgmz6u8XpyuVeu8wfzt6bsNyDW13XeF2hhQ532ymI3VrnxPWT5X+3?= =?us-ascii?Q?wTi8lFJid4AmFb1dnUsTyhr7AcZPBS6Ad5KH30l0Ei1SXtNsPdrxq6yRg4cP?= =?us-ascii?Q?HEpgnRk7YOKmx2OBI79l1FqPQqQswfB3ZrHqUaePTsWldM5awS1Sy3Q5OpMQ?= =?us-ascii?Q?UwK3G3iDi3TF/29AmyGSd27LIPwOplczuMaDz9qtLz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dMYSFB6exVzq2v6vdQz1CXKCUACp0ygur3Ohw?= =?us-ascii?Q?1odh0Le0xwiUnzJkpaUJ3V6uKRogXplDmu2/1vDfoWNH3i6y3sEYBkKk2iSh?= =?us-ascii?Q?GGbBpNJTxxzIprtf6LlWa+mmDkKjfxcKj3qZnpZbPaR0LL38mPoIXEfVxlD4?= =?us-ascii?Q?wiZIjrn4h08rQEnk58bPhdFa+Vr2ved2r2GCswJ6gwh4CM5xYwwY4GiNXmRu?= =?us-ascii?Q?+g/lp+raaOv/fexYZt6cEpjq41fidC+yp9w70Rym?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cd3702b-08ee-4dd9-6a58-08dcece904a7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 07:14:33.2837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wHE+V9KADijGdmSju4i1YMjBa7s5DVCrryinxFYxZJoI31SQdga8zcM/Ot6qgSCO X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7522 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 Include rte_pmd_dpaax_qdma.h instead of rte_pmd_dpaa2_qdma.h and change code accordingly. Signed-off-by: Jun Yang --- doc/api/doxy-api-index.md | 2 +- doc/api/doxy-api.conf.in | 2 +- drivers/common/dpaax/meson.build | 3 +- drivers/common/dpaax/rte_pmd_dpaax_qdma.h | 23 +++++++ drivers/dma/dpaa2/dpaa2_qdma.c | 84 +++++++++++------------ drivers/dma/dpaa2/dpaa2_qdma.h | 10 +-- drivers/dma/dpaa2/meson.build | 4 +- drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 23 ------- 8 files changed, 72 insertions(+), 79 deletions(-) create mode 100644 drivers/common/dpaax/rte_pmd_dpaax_qdma.h delete mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index abd44b1861..53e963ed47 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -57,7 +57,7 @@ The public API headers are grouped by topics: [mlx5](@ref rte_pmd_mlx5.h), [dpaa2_mempool](@ref rte_dpaa2_mempool.h), [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h), - [dpaa2_qdma](@ref rte_pmd_dpaa2_qdma.h), + [dpaax](@ref rte_pmd_dpaax_qdma.h), [crypto_scheduler](@ref rte_cryptodev_scheduler.h), [dlb2](@ref rte_pmd_dlb2.h), [ifpga](@ref rte_pmd_ifpga.h) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index a8823c046f..33250d867c 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -8,7 +8,7 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/bus/vdev \ @TOPDIR@/drivers/crypto/cnxk \ @TOPDIR@/drivers/crypto/scheduler \ - @TOPDIR@/drivers/dma/dpaa2 \ + @TOPDIR@/drivers/common/dpaax \ @TOPDIR@/drivers/event/dlb2 \ @TOPDIR@/drivers/event/cnxk \ @TOPDIR@/drivers/mempool/cnxk \ diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build index a162779116..db61b76ce3 100644 --- a/drivers/common/dpaax/meson.build +++ b/drivers/common/dpaax/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2018 NXP +# Copyright 2018, 2024 NXP if not is_linux build = false @@ -16,3 +16,4 @@ endif if cc.has_argument('-Wno-pointer-arith') cflags += '-Wno-pointer-arith' endif +headers = files('rte_pmd_dpaax_qdma.h') diff --git a/drivers/common/dpaax/rte_pmd_dpaax_qdma.h b/drivers/common/dpaax/rte_pmd_dpaax_qdma.h new file mode 100644 index 0000000000..2552a4adfb --- /dev/null +++ b/drivers/common/dpaax/rte_pmd_dpaax_qdma.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021-2024 NXP + */ + +#ifndef _RTE_PMD_DPAAX_QDMA_H_ +#define _RTE_PMD_DPAAX_QDMA_H_ + +#include + +#define RTE_DPAAX_QDMA_COPY_IDX_OFFSET 8 +#define RTE_DPAAX_QDMA_SG_IDX_ADDR_ALIGN \ + RTE_BIT64(RTE_DPAAX_QDMA_COPY_IDX_OFFSET) +#define RTE_DPAAX_QDMA_SG_IDX_ADDR_MASK \ + (RTE_DPAAX_QDMA_SG_IDX_ADDR_ALIGN - 1) +#define RTE_DPAAX_QDMA_SG_SUBMIT(idx_addr, flag) \ + (((uint64_t)idx_addr) | (flag)) + +#define RTE_DPAAX_QDMA_COPY_SUBMIT(idx, flag) \ + ((idx << RTE_DPAAX_QDMA_COPY_IDX_OFFSET) | (flag)) + +#define RTE_DPAAX_QDMA_JOB_SUBMIT_MAX 64 +#define RTE_DMA_CAPA_DPAAX_QDMA_FLAGS_INDEX RTE_BIT64(63) +#endif /* _RTE_PMD_DPAAX_QDMA_H_ */ diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 5e7640ae08..71e9ffdfc1 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -10,7 +10,7 @@ #include -#include "rte_pmd_dpaa2_qdma.h" +#include #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" @@ -243,16 +243,16 @@ fle_sdd_pre_populate(struct qdma_cntx_fle_sdd *fle_sdd, } /* source frame list to source buffer */ DPAA2_SET_FLE_ADDR(&fle[DPAA2_QDMA_SRC_FLE], src); -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_SRC_FLE]); -#endif + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + * + * DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_SRC_FLE]); + * DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_DST_FLE]); + */ fle[DPAA2_QDMA_SRC_FLE].word4.fmt = fmt; /* destination frame list to destination buffer */ DPAA2_SET_FLE_ADDR(&fle[DPAA2_QDMA_DST_FLE], dest); -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_DST_FLE]); -#endif fle[DPAA2_QDMA_DST_FLE].word4.fmt = fmt; /* Final bit: 1, for last frame list */ @@ -266,23 +266,21 @@ sg_entry_pre_populate(struct qdma_cntx_sg *sg_cntx) struct qdma_sg_entry *src_sge = sg_cntx->sg_src_entry; struct qdma_sg_entry *dst_sge = sg_cntx->sg_dst_entry; - for (i = 0; i < RTE_DPAA2_QDMA_JOB_SUBMIT_MAX; i++) { + for (i = 0; i < RTE_DPAAX_QDMA_JOB_SUBMIT_MAX; i++) { /* source SG */ src_sge[i].ctrl.sl = QDMA_SG_SL_LONG; src_sge[i].ctrl.fmt = QDMA_SG_FMT_SDB; -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - src_sge[i].ctrl.bmt = QDMA_SG_BMT_ENABLE; -#else + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + */ src_sge[i].ctrl.bmt = QDMA_SG_BMT_DISABLE; -#endif /* destination SG */ dst_sge[i].ctrl.sl = QDMA_SG_SL_LONG; dst_sge[i].ctrl.fmt = QDMA_SG_FMT_SDB; -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - dst_sge[i].ctrl.bmt = QDMA_SG_BMT_ENABLE; -#else + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + */ dst_sge[i].ctrl.bmt = QDMA_SG_BMT_DISABLE; -#endif } } @@ -381,21 +379,19 @@ sg_entry_populate(const struct rte_dma_sge *src, src_sge->data_len.data_len_sl0 = src[i].length; src_sge->ctrl.sl = QDMA_SG_SL_LONG; src_sge->ctrl.fmt = QDMA_SG_FMT_SDB; -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - src_sge->ctrl.bmt = QDMA_SG_BMT_ENABLE; -#else + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + */ src_sge->ctrl.bmt = QDMA_SG_BMT_DISABLE; -#endif dst_sge->addr_lo = (uint32_t)dst[i].addr; dst_sge->addr_hi = (dst[i].addr >> 32); dst_sge->data_len.data_len_sl0 = dst[i].length; dst_sge->ctrl.sl = QDMA_SG_SL_LONG; dst_sge->ctrl.fmt = QDMA_SG_FMT_SDB; -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - dst_sge->ctrl.bmt = QDMA_SG_BMT_ENABLE; -#else + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + */ dst_sge->ctrl.bmt = QDMA_SG_BMT_DISABLE; -#endif total_len += src[i].length; if (i == (nb_sge - 1)) { @@ -475,17 +471,16 @@ fle_populate(struct qbman_fle fle[], } /* source frame list to source buffer */ DPAA2_SET_FLE_ADDR(&fle[DPAA2_QDMA_SRC_FLE], src_iova); -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_SRC_FLE]); -#endif + /** IOMMU is always on for either VA or PA mode, + * so Bypass Memory Translation should be disabled. + * DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_SRC_FLE]); + * DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_DST_FLE]); + */ fle[DPAA2_QDMA_SRC_FLE].word4.fmt = fmt; DPAA2_SET_FLE_LEN(&fle[DPAA2_QDMA_SRC_FLE], len); /* destination frame list to destination buffer */ DPAA2_SET_FLE_ADDR(&fle[DPAA2_QDMA_DST_FLE], dst_iova); -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - DPAA2_SET_FLE_BMT(&fle[DPAA2_QDMA_DST_FLE]); -#endif fle[DPAA2_QDMA_DST_FLE].word4.fmt = fmt; DPAA2_SET_FLE_LEN(&fle[DPAA2_QDMA_DST_FLE], len); @@ -591,7 +586,7 @@ dpaa2_qdma_long_fmt_dump(const struct qbman_fle *fle) DPAA2_QDMA_INFO("long format/SG format, job number:%d", cntx_sg->job_nb); if (!cntx_sg->job_nb || - cntx_sg->job_nb > RTE_DPAA2_QDMA_JOB_SUBMIT_MAX) { + cntx_sg->job_nb > RTE_DPAAX_QDMA_JOB_SUBMIT_MAX) { DPAA2_QDMA_ERR("Invalid SG job number:%d", cntx_sg->job_nb); return; @@ -641,9 +636,9 @@ dpaa2_qdma_copy_sg(void *dev_private, return -EINVAL; } - if (unlikely(nb_src > RTE_DPAA2_QDMA_JOB_SUBMIT_MAX)) { + if (unlikely(nb_src > RTE_DPAAX_QDMA_JOB_SUBMIT_MAX)) { DPAA2_QDMA_ERR("SG entry number(%d) > MAX(%d)", - nb_src, RTE_DPAA2_QDMA_JOB_SUBMIT_MAX); + nb_src, RTE_DPAAX_QDMA_JOB_SUBMIT_MAX); return -EINVAL; } @@ -662,11 +657,7 @@ dpaa2_qdma_copy_sg(void *dev_private, cntx_sg->cntx_idx[i] = idx_addr[i]; } -#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA - cntx_iova = rte_mempool_virt2iova(cntx_sg); -#else - cntx_iova = DPAA2_VADDR_TO_IOVA(cntx_sg); -#endif + cntx_iova = (uint64_t)cntx_sg - qdma_vq->fle_iova2va_offset; fle = cntx_sg->fle_sdd.fle; fle_iova = cntx_iova + @@ -698,8 +689,7 @@ dpaa2_qdma_copy_sg(void *dev_private, offsetof(struct qdma_cntx_sg, sg_src_entry); dst_sge_iova = cntx_iova + offsetof(struct qdma_cntx_sg, sg_dst_entry); - len = sg_entry_populate(src, dst, - cntx_sg, nb_src); + len = sg_entry_populate(src, dst, cntx_sg, nb_src); fle_populate(fle, sdd, sdd_iova, &qdma_vq->rbp, src_sge_iova, dst_sge_iova, len, @@ -1042,7 +1032,7 @@ dpaa2_qdma_dequeue(void *dev_private, q_storage->last_num_pkts); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage, - (size_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + DPAA2_VADDR_TO_IOVA(dq_storage), 1); if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { while (!qbman_check_command_complete( get_swp_active_dqs( @@ -1077,7 +1067,7 @@ dpaa2_qdma_dequeue(void *dev_private, qbman_pull_desc_set_numframes(&pulldesc, pull_size); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage1, - (size_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); + DPAA2_VADDR_TO_IOVA(dq_storage1), 1); /* Check if the previous issued command is completed. * Also seems like the SWP is shared between the Ethernet Driver @@ -1109,7 +1099,7 @@ dpaa2_qdma_dequeue(void *dev_private, } fd = qbman_result_DQ_fd(dq_storage); ret = dpaa2_qdma_dq_fd(fd, qdma_vq, &free_space, &fle_elem_nb); - if (ret || free_space < RTE_DPAA2_QDMA_JOB_SUBMIT_MAX) + if (ret || free_space < RTE_DPAAX_QDMA_JOB_SUBMIT_MAX) pending = 0; dq_storage++; @@ -1162,11 +1152,11 @@ dpaa2_qdma_info_get(const struct rte_dma_dev *dev, RTE_DMA_CAPA_SILENT | RTE_DMA_CAPA_OPS_COPY | RTE_DMA_CAPA_OPS_COPY_SG; - dev_info->dev_capa |= RTE_DMA_CAPA_DPAA2_QDMA_FLAGS_INDEX; + dev_info->dev_capa |= RTE_DMA_CAPA_DPAAX_QDMA_FLAGS_INDEX; dev_info->max_vchans = dpdmai_dev->num_queues; dev_info->max_desc = DPAA2_QDMA_MAX_DESC; dev_info->min_desc = DPAA2_QDMA_MIN_DESC; - dev_info->max_sges = RTE_DPAA2_QDMA_JOB_SUBMIT_MAX; + dev_info->max_sges = RTE_DPAAX_QDMA_JOB_SUBMIT_MAX; dev_info->dev_name = dev->device->name; if (dpdmai_dev->qdma_dev) dev_info->nb_vchans = dpdmai_dev->qdma_dev->num_vqs; @@ -1347,6 +1337,7 @@ dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, uint32_t pool_size; char pool_name[64]; int ret; + uint64_t iova, va; DPAA2_QDMA_FUNC_TRACE(); @@ -1382,6 +1373,9 @@ dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, DPAA2_QDMA_ERR("%s create failed", pool_name); return -ENOMEM; } + iova = qdma_dev->vqs[vchan].fle_pool->mz->iova; + va = qdma_dev->vqs[vchan].fle_pool->mz->addr_64; + qdma_dev->vqs[vchan].fle_iova2va_offset = va - iova; if (qdma_dev->is_silent) { ret = rte_mempool_get_bulk(qdma_dev->vqs[vchan].fle_pool, diff --git a/drivers/dma/dpaa2/dpaa2_qdma.h b/drivers/dma/dpaa2/dpaa2_qdma.h index 250c83c83c..0fd1debaf8 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.h +++ b/drivers/dma/dpaa2/dpaa2_qdma.h @@ -220,18 +220,18 @@ struct qdma_cntx_fle_sdd { struct qdma_cntx_sg { struct qdma_cntx_fle_sdd fle_sdd; - struct qdma_sg_entry sg_src_entry[RTE_DPAA2_QDMA_JOB_SUBMIT_MAX]; - struct qdma_sg_entry sg_dst_entry[RTE_DPAA2_QDMA_JOB_SUBMIT_MAX]; - uint16_t cntx_idx[RTE_DPAA2_QDMA_JOB_SUBMIT_MAX]; + struct qdma_sg_entry sg_src_entry[RTE_DPAAX_QDMA_JOB_SUBMIT_MAX]; + struct qdma_sg_entry sg_dst_entry[RTE_DPAAX_QDMA_JOB_SUBMIT_MAX]; + uint16_t cntx_idx[RTE_DPAAX_QDMA_JOB_SUBMIT_MAX]; uint16_t job_nb; uint16_t rsv[3]; } __rte_packed; #define DPAA2_QDMA_IDXADDR_FROM_SG_FLAG(flag) \ - ((void *)(uintptr_t)((flag) - ((flag) & RTE_DPAA2_QDMA_SG_IDX_ADDR_MASK))) + ((void *)(uintptr_t)((flag) - ((flag) & RTE_DPAAX_QDMA_SG_IDX_ADDR_MASK))) #define DPAA2_QDMA_IDX_FROM_FLAG(flag) \ - ((flag) >> RTE_DPAA2_QDMA_COPY_IDX_OFFSET) + ((flag) >> RTE_DPAAX_QDMA_COPY_IDX_OFFSET) /** Represents a DPDMAI device */ struct dpaa2_dpdmai_dev { diff --git a/drivers/dma/dpaa2/meson.build b/drivers/dma/dpaa2/meson.build index a99151e2a5..a523f5edb4 100644 --- a/drivers/dma/dpaa2/meson.build +++ b/drivers/dma/dpaa2/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2021 NXP +# Copyright 2021, 2024 NXP if not is_linux build = false @@ -14,5 +14,3 @@ sources = files('dpaa2_qdma.c') if cc.has_argument('-Wno-pointer-arith') cflags += '-Wno-pointer-arith' endif - -headers = files('rte_pmd_dpaa2_qdma.h') diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h deleted file mode 100644 index df21b39cae..0000000000 --- a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2021-2023 NXP - */ - -#ifndef _RTE_PMD_DPAA2_QDMA_H_ -#define _RTE_PMD_DPAA2_QDMA_H_ - -#include - -#define RTE_DPAA2_QDMA_COPY_IDX_OFFSET 8 -#define RTE_DPAA2_QDMA_SG_IDX_ADDR_ALIGN \ - RTE_BIT64(RTE_DPAA2_QDMA_COPY_IDX_OFFSET) -#define RTE_DPAA2_QDMA_SG_IDX_ADDR_MASK \ - (RTE_DPAA2_QDMA_SG_IDX_ADDR_ALIGN - 1) -#define RTE_DPAA2_QDMA_SG_SUBMIT(idx_addr, flag) \ - (((uint64_t)idx_addr) | (flag)) - -#define RTE_DPAA2_QDMA_COPY_SUBMIT(idx, flag) \ - ((idx << RTE_DPAA2_QDMA_COPY_IDX_OFFSET) | (flag)) - -#define RTE_DPAA2_QDMA_JOB_SUBMIT_MAX (32 + 8) -#define RTE_DMA_CAPA_DPAA2_QDMA_FLAGS_INDEX RTE_BIT64(63) -#endif /* _RTE_PMD_DPAA2_QDMA_H_ */ -- 2.25.1