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 50C59A0547; Thu, 9 Sep 2021 13:15:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 724F641122; Thu, 9 Sep 2021 13:15:26 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2053.outbound.protection.outlook.com [40.107.22.53]) by mails.dpdk.org (Postfix) with ESMTP id 916BF410F7 for ; Thu, 9 Sep 2021 13:15:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8BtoH1v3f542R3+tCJVHTyBu1V+eFU1DEgJXfEXcS1WJC4KAlNu+kgA8h8+ZWUFIoGK/GiB5ohzgmoh4e0t2HoWZmSmG5QnUS/c32IuQIlVUDMpkmNydCTWST4djvzw1wkKVNQ3yw4e3sLRhUX2DMONZhmIyAoBHiRS46+dfAi8hmDoGotErRiOKubLd4X+LvfL/iO3RpuCVKEfO+038LFU+aURotKcYaJHkeMGK2ueXGbJNZH+bXM2XE8xPMVJjEtIXJlyw1r5qIRH9anvCwwGHXdrFsCGr7DFYnW1XYLbDcKsLVQtmIVX5k+Aykvt7cKKoDNTiqDnGzKJSBp9nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qH58MYL50c4pg6yzaABc9fy3DdahccRFx7q29+QI4kM=; b=cgdVIUCy56tC5NjCxOidhI0qlv2P7wkvw7mqc1ZQv2NWD++Iu3yEXcVOZt2RsWp0l/uijz6twE5jXuits/8EFW3VDxl+lrY8KV3EzwV7OuanMrfyPmtbJclK1k2FFQyqqcrBgK6Rv8f2mPqJHR3rpe0emflElK0QlPZ677udLFFyvAc00JyBtLWuXzG1BQOzUFTLWXYKS1oYyC66fqufNGP76aq6AnveJcPXyvj0xhaFBZLQV2ymH57tVv+dYgjrKKKlhzSR7EtoZns4ToxDZZu7Ku4Fyhb4My2UhfyDSFSRo53crmxVYWBs1QXkMz6UTJHBjde88NH9kMYNyaXcCQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qH58MYL50c4pg6yzaABc9fy3DdahccRFx7q29+QI4kM=; b=SMaX8NQv2ugPoxHzkjt6rRZPAdvfo76FJfNGciqLpSUpSbw9HnAfa81Ez6YgJYzY46lUrtqbH/doapih4HR9O25MT9rPRBl/hva4HTOZDQOsmpoot4Az2XeIF+lgsBsBu5wEsd5urfQggV9M1TF6wCMcpWMPDIan2axMI2cDDj8= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VI1PR0401MB2367.eurprd04.prod.outlook.com (2603:10a6:800:24::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Thu, 9 Sep 2021 11:15:24 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7%8]) with mapi id 15.20.4500.015; Thu, 9 Sep 2021 11:15:24 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: nipun.gupta@nxp.com, thomas@monjalon.net, Gagandeep Singh Date: Thu, 9 Sep 2021 16:44:55 +0530 Message-Id: <20210909111500.3901706-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210909111500.3901706-1-g.singh@nxp.com> References: <20210909111500.3901706-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0149.apcprd06.prod.outlook.com (2603:1096:1:1f::27) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0149.apcprd06.prod.outlook.com (2603:1096:1:1f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 9 Sep 2021 11:15:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93edac60-d439-4fcf-bf9c-08d973831eb0 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2367: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PD49PsX6mVFE0VEyN4tmqct44TKu+006ftELSdKkaXozSVoWatWmAwSQul/RIM2doCfO73B5uQKy9j0zcVK59+/KaQUkdwbapmNSvmMpF4nMGq/oTzskD6V90KF1nv6m70a1zUbuOADOZBhvn2+NJ83M7FzME/rHHuexwpy5U+n5VfGkiVjc6WwsBqiMSwL2HDR/RpNHk5TRzrHXdgYPnkuNkT98doTfugrSqFpvn8Mh9Oo76o6VzaiK69OjFlOll46JnzGApzNHkLP2OZwkU1DtxEL0egOXfLjeGeYtee7rq4SGVtHVZTVonIgnQ6+NCNojQlidfxedsVTisDUp2D7PQDDXG65eaXUPPg9c666OrroZ/Ps2H//YBZi3ZfBu/1T5vCO3C5Le+Uk4/HxoucbpgxE/9y1LDHvpR/vchrwMWRTIqmDYaJuzuprReBYtrJBIjqxcYkTsVKwZAlKXYsQQEN7sFqyVqUbMLlvmfDFPf0f7e9tvmn1NRNxYIyaQAfXLVEIxMNp8Tsopq1XYseCmADzDdsrJ0ZImkX5oqITk2M4oNvxPxB4iGZAVXobfJqWplxgITfi3qvN9hKpSyPWzD2/Sak9GxtmoowLPtG/XVC86eX92e4v3aUSS4vnzHpTPm3rwTd0ORsubZ6EsGnO4El3YMUh9/P4iuen7i0uF/qsJ66hSEf5ohnm2eCo7LUvaO400b32Gy2UTUxF8scV/5hcJDnqAa6WfbuZHUA8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6960.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(39860400002)(376002)(366004)(66476007)(6486002)(7696005)(66556008)(186003)(52116002)(86362001)(36756003)(8676002)(1006002)(5660300002)(956004)(4326008)(6666004)(2616005)(66946007)(6916009)(478600001)(1076003)(38350700002)(8936002)(38100700002)(26005)(316002)(2906002)(55236004)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DHtHlgz61vFpjhKAY8eU8zJXtTHBttQOpJtJD3uweKvtKfvCPC+4OVIEqotG?= =?us-ascii?Q?sNYiVOKUf3abMmwc3vMCElI1IT+LCet0a0KjZRsE6kx+gMFyfV2twesiV0ZT?= =?us-ascii?Q?9RNanWQ+gBpMCOFb8iA4hZWf7FXdAjKxN7VpqDvbNKsshYZBTrq6SbmclSok?= =?us-ascii?Q?yqeA5blJRheLp2rHbcKIauItgIMX3de49JGtxalfNBGEpZJuK+2PGwzNiSvp?= =?us-ascii?Q?pXR6dMfke4MWb0sTB+h+cRpYmQgd17B0OFk9RV6zUpIjmx8tyVioDZqkUWIL?= =?us-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729cYj6WiwQsSpHPkuvvDoXe4bDYSqzr5uf?= =?us-ascii?Q?YvDhbIlwGnBeu9Fqouz1HuPpdnbWjyKAt9W6KpJx0mpty/aA0kFrLrka1ZhY?= =?us-ascii?Q?PKDCjMz4kQHsI3K25WMDAgkRGthTpw2hqTpAWDp+fwqyWfc7r/fqaKCYfS++?= =?us-ascii?Q?cXh5vKiYApB0/bJHAXeVdW8m?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93edac60-d439-4fcf-bf9c-08d973831eb0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 11:15:24.7433 (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: /s58F/P1fcrHk0yh1CUpwnIs5tv79iuLpmiATgI77GLNldj6wVQ+gl1eb73Q//4V X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2367 Subject: [dpdk-dev] [PATCH 1/6] dma/dpaa: introduce DPAA DMA driver 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 Sender: "dev" The DPAA DMA driver is an implementation of the dmadev APIs, that provide means to initiate a DMA transaction from CPU. The initiated DMA is performed without CPU being involved in the actual DMA transaction. This is achieved via using the QDMA controller of DPAA SoC. Signed-off-by: Gagandeep Singh --- MAINTAINERS | 10 +++++++++ doc/guides/rel_notes/release_21_11.rst | 3 +++ drivers/bus/dpaa/dpaa_bus.c | 22 ++++++++++++++++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 5 +++++ drivers/common/dpaax/dpaa_list.h | 2 ++ drivers/dma/dpaa/dpaa_qdma.c | 28 ++++++++++++++++++++++++++ drivers/dma/dpaa/meson.build | 14 +++++++++++++ drivers/dma/dpaa/version.map | 4 ++++ drivers/dma/meson.build | 1 + 9 files changed, 89 insertions(+) create mode 100644 drivers/dma/dpaa/dpaa_qdma.c create mode 100644 drivers/dma/dpaa/meson.build create mode 100644 drivers/dma/dpaa/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 266f5ac1da..e3113b2e7e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1341,6 +1341,16 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst + +Dmadev Drivers +-------------- + +NXP DPAA DMA +M: Gagandeep Singh +M: Nipun Gupta +F: drivers/dma/dpaa/ + + Packet processing ----------------- diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index d707a554ef..d322bc93af 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added NXP DPAA DMA driver.** + + * Added a new dmadev driver for NXP DPAA platform. Removed Items ------------- diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index e499305d85..09cd30d41c 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -232,6 +232,28 @@ dpaa_create_device_list(void) rte_dpaa_bus.device_count += i; + /* Creating QDMA Device */ + for (i = 0; i < RTE_DPAA_QDMA_DEVICES; i++) { + dev = calloc(1, sizeof(struct rte_dpaa_device)); + if (!dev) { + DPAA_BUS_LOG(ERR, "Failed to allocate QDMA device"); + ret = -1; + goto cleanup; + } + + dev->device_type = FSL_DPAA_QDMA; + dev->id.dev_id = rte_dpaa_bus.device_count + i; + + memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); + sprintf(dev->name, "dpaa_qdma-%d", i+1); + DPAA_BUS_LOG(INFO, "%s qdma device added", dev->name); + dev->device.name = dev->name; + dev->device.devargs = dpaa_devargs_lookup(dev); + + dpaa_add_to_device_list(dev); + } + rte_dpaa_bus.device_count += i; + return 0; cleanup: diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 48d5cf4625..678a126154 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -61,6 +61,9 @@ dpaa_seqn(struct rte_mbuf *mbuf) /** Device driver supports link state interrupt */ #define RTE_DPAA_DRV_INTR_LSC 0x0008 +/** Number of supported QDMA devices */ +#define RTE_DPAA_QDMA_DEVICES 1 + #define RTE_DEV_TO_DPAA_CONST(ptr) \ container_of(ptr, const struct rte_dpaa_device, device) @@ -76,6 +79,7 @@ TAILQ_HEAD(rte_dpaa_driver_list, rte_dpaa_driver); enum rte_dpaa_type { FSL_DPAA_ETH = 1, FSL_DPAA_CRYPTO, + FSL_DPAA_QDMA }; struct rte_dpaa_bus { @@ -98,6 +102,7 @@ struct rte_dpaa_device { union { struct rte_eth_dev *eth_dev; struct rte_cryptodev *crypto_dev; + struct rte_dmadev *dmadev; }; struct rte_dpaa_driver *driver; struct dpaa_device_id id; diff --git a/drivers/common/dpaax/dpaa_list.h b/drivers/common/dpaax/dpaa_list.h index e94575982b..319a3562ab 100644 --- a/drivers/common/dpaax/dpaa_list.h +++ b/drivers/common/dpaax/dpaa_list.h @@ -35,6 +35,8 @@ do { \ const struct list_head *__p298 = (p); \ ((__p298->next == __p298) && (__p298->prev == __p298)); \ }) +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) #define list_add(p, l) \ do { \ struct list_head *__p298 = (p); \ diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c new file mode 100644 index 0000000000..2ef3ee0c35 --- /dev/null +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021 NXP + */ + +#include + +static int +dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv, + __rte_unused struct rte_dpaa_device *dpaa_dev) +{ + return 0; +} + +static int +dpaa_qdma_remove(__rte_unused struct rte_dpaa_device *dpaa_dev) +{ + return 0; +} + +static struct rte_dpaa_driver rte_dpaa_qdma_pmd; + +static struct rte_dpaa_driver rte_dpaa_qdma_pmd = { + .drv_type = FSL_DPAA_QDMA, + .probe = dpaa_qdma_probe, + .remove = dpaa_qdma_remove, +}; + +RTE_PMD_REGISTER_DPAA(dpaa_qdma, rte_dpaa_qdma_pmd); diff --git a/drivers/dma/dpaa/meson.build b/drivers/dma/dpaa/meson.build new file mode 100644 index 0000000000..9ab0862ede --- /dev/null +++ b/drivers/dma/dpaa/meson.build @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2021 NXP + +if not is_linux + build = false + reason = 'only supported on linux' +endif + +deps += ['dmadev', 'bus_dpaa'] +sources = files('dpaa_qdma.c') + +if cc.has_argument('-Wno-pointer-arith') + cflags += '-Wno-pointer-arith' +endif diff --git a/drivers/dma/dpaa/version.map b/drivers/dma/dpaa/version.map new file mode 100644 index 0000000000..7bab7bea48 --- /dev/null +++ b/drivers/dma/dpaa/version.map @@ -0,0 +1,4 @@ +DPDK_22 { + + local: *; +}; diff --git a/drivers/dma/meson.build b/drivers/dma/meson.build index 0c2c34cd00..2f22d65215 100644 --- a/drivers/dma/meson.build +++ b/drivers/dma/meson.build @@ -7,5 +7,6 @@ endif drivers = [ 'skeleton', + 'dpaa', ] std_deps = ['dmadev'] -- 2.25.1