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 98C0BA0C4B; Mon, 8 Nov 2021 10:07:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71DED4111C; Mon, 8 Nov 2021 10:07:32 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150057.outbound.protection.outlook.com [40.107.15.57]) by mails.dpdk.org (Postfix) with ESMTP id 240A94111F for ; Mon, 8 Nov 2021 10:07:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioRwtxz6sbiOw1UOhoNHWgFk0LZ1uAaAqV8cpSsocF/MlUWDKGmORNx1mvzS975UF2OAww15u1QWn0Fx68kNRyL6jVWxoFLuuk8ZPWA75IR3SOqz4fIHT0l9fG6ATyeXy8MLjlQyqbFvlh27jFo2U9kqdOgFdtY24NrVXh6ijrf3htoWNAG/FK3mcUbwaj4YIH6D2A386WT7XlGXiVbsRB1oGFtzp5EkiC5hCviB1/rW0Wi1c7JB2rT9nARTq/p4T28zxtmADzw4jS0hhfYHT7wtiIOlJRaqQHLIe4KV7OIkMPYV+AFoIAM4+sXA43Jb9XaqfFYUunmVCytxCHbF0w== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kz1FgNc75adefoJwg423poQA+UPXh+YArmfKZF3ql7U=; b=ACVpbuW4dkygBBVIGmXQgEgzS1RvO62JHIvgb3Qh4hujLwtN5xxD4EuMDupYfCI6aNZLZzxhtSxIUsmEGYurLjvB7d0GRiT2bxQJ74tBQIJmiiLqZ16WWc6JU3HoQCE+03S9vUTTH0VU42LNTBhMVdOGvysSvUvYc/IZTr7RnqCjdQuQfqF8qjeY6L0hwEaIFFLUcBESKdr0wG2owDoNocj1noCASh+pCCkdt9Z0SYhDBU6ie3BhucoIEwXwPx11/Wi0orOzZdlvycr7JjA/9yNWCzeZraXf7RSfG0Bet2dpeSaWLoAzlLXX+789hqmMBOAIZOXNIcJDRSvFdT3Zwg== 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=kz1FgNc75adefoJwg423poQA+UPXh+YArmfKZF3ql7U=; b=KRBJBNrHMlGLfWdVOhpreA5WBDomTNjPVOvyP7Jw/kmqmyTR8ux0jO0q9NOkOI6iRrBawgllJlAJaLVzEvOgwOxykR/rnKOfnqTxRhwZZQ1eZDOHNo+/I57fb/FusuiK+cZIxolcv9KJJt8Afjh+wRIhIjL1ycLONWszsn8GBpg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VE1PR04MB6495.eurprd04.prod.outlook.com (2603:10a6:803:11d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Mon, 8 Nov 2021 09:07:29 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::11d9:6f32:90e:80c1]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::11d9:6f32:90e:80c1%7]) with mapi id 15.20.4669.016; Mon, 8 Nov 2021 09:07:29 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: nipun.gupta@nxp.com, thomas@monjalon.net, Gagandeep Singh Date: Mon, 8 Nov 2021 14:36:58 +0530 Message-Id: <20211108090704.3585175-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211108090704.3585175-1-g.singh@nxp.com> References: <20211101085143.2472241-2-g.singh@nxp.com> <20211108090704.3585175-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0077.apcprd02.prod.outlook.com (2603:1096:4:90::17) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0077.apcprd02.prod.outlook.com (2603:1096:4:90::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Mon, 8 Nov 2021 09:07:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13a4fbf6-c347-42ac-afca-08d9a2973098 X-MS-TrafficTypeDiagnostic: VE1PR04MB6495: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +tg12o7a8btUIGbvn5rzFsaMVPwYArW2Y3hi2zNaKRK5F8Ko28yXNlcX9cqazn41GhzP80d1rCh31Gop4ZSgx7Tn+5ul8WjWcW3JaMkQj6fglUUOElAieckiffXUbTh1BzY2oD50ASpRSUJEZwrmAOpxINtMxs8lFb91AL2FIkDpp7tNYELZ+Hb5wSFj/WYkZ4dvlFGbxkinieVbEYvsfhxwV3sOFcqgGUAsCf15YVgtq19qZMGTgKLNcZLGu/OxpdzyI4CLQrCLD5RxBDzuxqFtsAsqteiFNz5GTgYIavoh49xnxZ7hzzq5E4Y+JqCFzYiNFp0VFP2m0Vp0hpfngDeKsTZQiu8h4PWRLKXtfnQ7blhOR4U1VV5oWJid25b6UmhHxAj9uFRsKw//hP3wWUIDp8KCf+RmLP3HENBs8a1luJ1rNKCHy1aZwVhMkDjCqjvHVKgOiXUiZFlFCwrN/WnhWj3+8+77Hj/5nAex+SZzjZ9JCyBQPW4+0P9c4t5caAj3kYo3yljOIspTFRR1lRaZXOyvnQJjEH530kcR9Bq5oYcuLxLHLsbvomblj6MiT8BEiq/Lh7YDZr4IJnUe4JmbuvexBXm+JePbbho/JVyWu304DOnkDAOb84viO3pt6POnIM0cvMoV20J3uD4XhPuN/+t6Ff07eg50qHapnhs6hyUo+RXIr0xxuXPj7AnbJHFPwHZBMJO8vkXxrvBfl8ksVrncV+c7vK8CE/qAeuE= 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)(366004)(1006002)(8936002)(66556008)(5660300002)(6666004)(36756003)(26005)(55236004)(508600001)(2906002)(66476007)(38350700002)(38100700002)(8676002)(83380400001)(6916009)(1076003)(52116002)(7696005)(316002)(4326008)(956004)(186003)(2616005)(66946007)(6486002)(86362001)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p7aRNUcBMYp/BRHY/oNOqgoIWTNCc2L0YtIX2alDD9XIVmP7B4p153aX9FAt?= =?us-ascii?Q?B2/BkVVr6hDl1eBUlGawwW+Mn779wlMvK7vKZrTyWklhEI4yO0jNATvEsSe6?= =?us-ascii?Q?+w9A3QLF0zo1I9tlvDfWSsGPnwSLfEwy50eahQdhPiECFl/5xnpLeuPLxp5V?= =?us-ascii?Q?gPMgVPVoKtF8DayJPnw2TBnPUOOoB4Yx3RzRc9bdxOoWUC2Wq2keflIarNqn?= =?us-ascii?Q?u9apaoMZQuTA8l5Nw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vgDju+?= =?us-ascii?Q?mMDOE2yR1UZ1EoBXq0Y/QB/1IiHjm2Tv+M0GiLiuQGtxnSQNvdkHjRfwh553?= =?us-ascii?Q?fOcSJILUe0C46eLLc4FHYMQ8mL9Bc8lHorLY+aB3XR6HingzD8GkLmOlpiRB?= =?us-ascii?Q?NwOEFGtf1UMKRdibN/CkDnrJV44AXMZzBWRct4BbuxE2dxRI6L7Xwok7qmaJ?= =?us-ascii?Q?v/+kTtrD/4eNddKXaBpXSuoQaWgVnnNxAcusC8Fc6su2N1EyA7WBvXhgbzNf?= =?us-ascii?Q?eTOZX/kVqlryNnlG/FE95Xnc0vBPkKOvDEhJgifUQ+B38RLbrgDhfOrM2WSJ?= =?us-ascii?Q?t6q4DQTMtpyciwRepZS1n/HahW8hmvCLiQtCBixKOJj+XVIPPhF87+sgc7cX?= =?us-ascii?Q?otW6tdvDXjaV5isg8z1BSYOvb1X2Si+y2znWNsHqZq/ZyT9sPRfewboaga6n?= =?us-ascii?Q?diuZULoAd4LqqXbe6jA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13a4fbf6-c347-42ac-afca-08d9a2973098 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 09:07:29.1159 (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: lPHZTLKaSLmcpbKogTBFZFOTxXfBdQMTCwjun3aocmHL+xOsZNBOuaVahlpmbJEj X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6495 Subject: [dpdk-dev] [PATCH v3 1/7] 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 | 3 ++- 9 files changed, 90 insertions(+), 1 deletion(-) 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 0e5951f8f1..76b9fb8e6c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1353,6 +1353,16 @@ F: drivers/raw/dpaa2_qdma/ F: doc/guides/rawdevs/dpaa2_qdma.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 502cc5ceb2..8080ada721 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -20,6 +20,9 @@ DPDK Release 21.11 ninja -C build doc xdg-open build/doc/guides/html/rel_notes/release_21_11.html +* **Added NXP DPAA DMA driver.** + + * Added a new dmadev driver for NXP DPAA platform. New Features ------------ diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 9a53fdc1fb..737ac8d8c5 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -250,6 +250,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 97d189f9b0..31a5ea3fca 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -58,6 +58,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) @@ -73,6 +76,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 { @@ -95,6 +99,7 @@ struct rte_dpaa_device { union { struct rte_eth_dev *eth_dev; struct rte_cryptodev *crypto_dev; + struct rte_dma_dev *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 a69418ce9b..37c5c31445 100644 --- a/drivers/dma/meson.build +++ b/drivers/dma/meson.build @@ -2,7 +2,8 @@ # Copyright 2021 HiSilicon Limited drivers = [ - 'idxd', + 'dpaa', + 'idxd', 'ioat', 'skeleton', ] -- 2.25.1