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 24B5FA0C57; Mon, 1 Nov 2021 09:52:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 180A2410FE; Mon, 1 Nov 2021 09:52:11 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2088.outbound.protection.outlook.com [40.107.22.88]) by mails.dpdk.org (Postfix) with ESMTP id 9C83A410FC for ; Mon, 1 Nov 2021 09:52:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fxwch9GCBlt4EUnaMtS/MlqL6j9R0IM8PvU8m/+IhFXoi3/CJZzpiFkYjiUy3QOHPg705sbAQprMW6RuXV6G3sfIShbv14riVQUlzhQEv5s3MLiMpfty+++E7vGpI4kX0E3UgRzh1vWu+YIMGJvQT7dQU5rPeIrH+zo3B/8vvYYGAs49zjFK1if+hD5na/dCw3bCk1b6PvGi/zsg/hJ+VJsvd4QR+DYT3nSpihsC63L6/xniKEEWDDzj/6XNkhafT9hwmvLxqi79lSDXSDVu1fEYaqv/cI8thUI2uq7BwEqNf0l0qCB0NbTf2xUzLbgO8c9Na5OC/pDiD8UHKxx0EQ== 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=zs5AMYp1TlYxhX9zdDOWPGto797wdPjDWR/mLoxtEUg=; b=YfUTUpr0CeLsjT+VoHtsPybtcXLaL4cxlghS3rFLMekDJDdMXZ9hpOqgqaD+bUTin+gUE6LN0iG8CwgT2L/1dUjLYdfV+aBcN9f912qOexdsLzp3/pZHAUW3QRz64KnY2p5EiN54C7v8d9MdeHqq4fm/RSihBdj539r6fYPzmREI+CuvxEUW5LY8vhMoQ+DV2NWgWM0/wO14PCdvrhqHOnvTvAj+Q0s3JtI3RItDlSEGvlRZahCtmfjT3m9TKOAmIGOFzUIEZ41uSVhHGN1GMfNoZL4RUMGoXY5NWGU2BGCZAByEm04ryH49Q8D1nnzklV1jrC52FNWD76dsPqp1tQ== 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=zs5AMYp1TlYxhX9zdDOWPGto797wdPjDWR/mLoxtEUg=; b=mn1mV7FrKKDOHqHewmjpeifHaBQgpG61xvf6/MsXpyYO8E/YXSWstNMnm498U77H8NlEIvRNXm1QFaeYfoQvtOiYBpoPwnGkQ41zWo7y73n8Rz2Q0rPZLp0wtHPsmc7MfYTgZMHpjN5BOrpNeWE47k1KHPt1irvOxgfj9ro+qN8= 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 VI1PR0402MB3614.eurprd04.prod.outlook.com (2603:10a6:803:b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18; Mon, 1 Nov 2021 08:52:08 +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.4649.019; Mon, 1 Nov 2021 08:52:08 +0000 From: Gagandeep Singh To: thomas@monjalon.net, dev@dpdk.org Cc: nipun.gupta@nxp.com, Gagandeep Singh Date: Mon, 1 Nov 2021 14:21:38 +0530 Message-Id: <20211101085143.2472241-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211101085143.2472241-1-g.singh@nxp.com> References: <20210909111500.3901706-1-g.singh@nxp.com> <20211101085143.2472241-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0092.apcprd02.prod.outlook.com (2603:1096:4:90::32) 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 SG2PR02CA0092.apcprd02.prod.outlook.com (2603:1096:4:90::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Mon, 1 Nov 2021 08:52:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a7b06f6-53ec-49fc-1052-08d99d14e30f X-MS-TrafficTypeDiagnostic: VI1PR0402MB3614: 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: lVbrSAgnJpcMpXoAhD+XAPMn7qOpHZUV8jQFHhm92PGuX0XsOGybHH2iauo2lBY+DfRVjBlhpPq2m4nBBQ2cXZYMf7iVh0nLB2u0Mtk73pabgapShglL4H+kV3MD6pKCqvIt10oh/Nx8lx36jXdYNIx4HCLVJisRbVX9ijPGG89uADw77pgLPG6cpbYS7S0R/Yd8IX6LyDoiqe7ebmJiQFUjRlZsZ9kjNY4SC2eyHbtn1dNxYpHsUT+DPyoRPlAI+7jetojUd1p6DyhrWoBRq1TdGXABvFTU+Q4NueWJ57V+4LfcTjMmI8jIYpqFP2P+amEP/BKagJJQdFdNpJuwxU9DJqsBRmZmjr6wQDGIyzHP5t9fuETHcvpzW/UTmrE8USBGxg/TEJuXmwynXSBCCMyTkdtOyVEnm8w3qBFz9pGpY9e0/lkE6aud/gvzlI7HYwEmzwosY9T0ZBMT8+9lAqeITSijR51XVZp0Cha2pijbA8mYetuBWRwDg8wJjSohV8Ca0vxBc/bZzkQGsVP6PAsgG+k0K1eAmbJupi1UNTVQRVrV5uIO1JlX97p8xASI4X4FjlqZ2I5d5zzsGuw+yHi+BOYfP6/V/HHQw9TRDF6WP9VY+zUuqDKjFE48xJCsTKI2mCrlFNM+nJ75eIIN2GiVD0FiFUvRu6r0D+Oq6l51L2pI9eJzb7bbnVpVsZXOh1XGGLVzMKh2smyV2B18GVv8QaSLGpMDIge83a+vnxM= 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)(508600001)(4326008)(316002)(6486002)(66946007)(55236004)(2906002)(52116002)(7696005)(66476007)(66556008)(5660300002)(956004)(1076003)(38350700002)(38100700002)(86362001)(2616005)(36756003)(8676002)(26005)(8936002)(186003)(6666004)(1006002)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EA9SygeJxHGl6Gi0IpcFaI0d/oyDz03ww23k7wi9mbWq4geUziZjp79b36BT?= =?us-ascii?Q?vZJXQDyvxtpb51oAotuoFXGkGrSZgeULtfhOGChDlJHXy4NWq3q8I1+5ICQL?= =?us-ascii?Q?7KAfT1ne6Wa2Qsa/cwasDqO/VSlJKhIp6sStWi5D15KwO2nECyhjmkZg7ZgU?= =?us-ascii?Q?qpV3QLEhbSYn/a+wG8xDiOM8XYMp09Zp45l+XvcbmIaBQb8Wj51C+2LwTB40?= =?us-ascii?Q?HioA1D7FnoH57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v2A4GtG4?= =?us-ascii?Q?CSmKIHJ6BlLD1CCAcA0tkGqEDJeJHvtRLwrEE70AIyKMUVO7nbCT6MLstVG8?= =?us-ascii?Q?hUilUgVeP46VQSwY3lpNlcqVjgnaNaTsLo9hHVOxBfFsNbsxVuY7yTyFJe2C?= =?us-ascii?Q?bVAbyX0URoGcY3Ud6PfAocXg6+LH6WKL+3sQ22ob639jCRc2nYz5H0SlQVIK?= =?us-ascii?Q?SeAFhg4+u3hXdSuDrZRyPp2UsCjqMYW7NYlvvDoZTVThEebRZlOG/2qFGI7Y?= =?us-ascii?Q?a/e70BbyBznrWBNDMdF3HcePth9SyrAX0SCUFKdfJIFtOtJiOxvc7jETl+Bo?= =?us-ascii?Q?asdl+LPVInF7NwRSKkOQ9IJoZ6NBZQpiINPOn02Sfz72bB3y2txtJcts7izS?= =?us-ascii?Q?vsQ9UFBwUxCz8nZ+R7IHZdCdSX31rlK1TethxgeUxXh1ZVhGnqnNkPZhmOf4?= =?us-ascii?Q?FjPQDFwfunnbiPgG+e8=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7b06f6-53ec-49fc-1052-08d99d14e30f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:52:08.7522 (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: XjloYuoQOQehL9NGhQAzuyt0HABU6+5h2lwUIqi7cY02KEeOOanOFtzr1cNIx1/Q X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3614 Subject: [dpdk-dev] [PATCH v2 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 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..ab2733f7f6 100644 --- a/drivers/dma/meson.build +++ b/drivers/dma/meson.build @@ -5,5 +5,6 @@ drivers = [ 'idxd', 'ioat', 'skeleton', + 'dpaa', ] std_deps = ['dmadev'] -- 2.25.1