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 71944A0C4B; Tue, 9 Nov 2021 05:39:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74EEC41100; Tue, 9 Nov 2021 05:39:44 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40046.outbound.protection.outlook.com [40.107.4.46]) by mails.dpdk.org (Postfix) with ESMTP id 2A766410E0 for ; Tue, 9 Nov 2021 05:39:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7EJ3qkJ6jtYJO4Zb+UlTt2HyanJBKyO56Bb8OMpLlF1KjVHn1rANlK7hakkIFUopNqdzgyIYtCjXMIJGXltTg9QlZGKUtuy74krkadVLNsGl/xQHFCSMEeidhDmwoWzdyeWF8JqdG5BDD0vQmAzY8xhpq7j/pgpXMYz4Hq8d8KRPJRtF2hHp2Y5jxoKmDi4RP1WlQQoHjmuv3+mNagt14Ktru4CTwNo+UGuD0XZf2b01t2m4D5eTdwSldKKD0hVaOmJ221priuSZ45SgtpsRvTuz2Urv56ML3GdNQiQVCXBpCZWtnHDUqL4SDSQbIVy1kXoiSVcQHWoDqaASww3QQ== 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=OV89GEpbuYs51eC70sZK+JFvKwdikCwR1b+ddooUb4k=; b=bDDqQNoyBqeCFeOmztBFxFVpEuOxP80xZ+ngkN65j4vDYwRvd2lcaT4X4XhX+Iol93sxwwdVf+Mad59/pIJvtiiUhu/gW5VH2UvtanbfYrN1lYzCDw2e/CHmnKAwx6ZeNA/KSHIHyx/WKfUasOi8IZLmOIvRUYRY6R4r+IljIQOTS2O88fkNNYEIFQnhvnWRUPv1UU2ZxVvTzIMJGE5KW88kUJKO5W26H5U90H+9rMI/djj3M+0mVBZsdHiEL4EiFXn+Ftmn7vzGzrbjQXnWnFcCVwPBK4Iev8v8cWo30xc2OBvavvU7QJcajvCRvM0NOMaM7t25L9uT2v1v9fMA+Q== 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=OV89GEpbuYs51eC70sZK+JFvKwdikCwR1b+ddooUb4k=; b=DAvnpmZjiPl0ztUPiCxAQ90+nW+naTFAzNH5yOLUS7XMVTGHcIzOZjGBF2lcjz9ux/Gw2NOdiyyekv9sUJJDqBeUdayLzkRJNsg5COgyE0ahvQlvSqI8ZyeNyB4ja9D9Ih1j1M/qKhR9y/6wI2Ah0J3C3eJzi0YTHeUJPAlnZpo= 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 VI1PR04MB5630.eurprd04.prod.outlook.com (2603:10a6:803:e6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Tue, 9 Nov 2021 04:39:40 +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; Tue, 9 Nov 2021 04:39:40 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: nipun.gupta@nxp.com, thomas@monjalon.net, Gagandeep Singh Date: Tue, 9 Nov 2021 10:09:06 +0530 Message-Id: <20211109043910.4016824-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211109043910.4016824-1-g.singh@nxp.com> References: <20211108090704.3585175-2-g.singh@nxp.com> <20211109043910.4016824-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2P153CA0002.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::16) 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 SI2P153CA0002.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.5 via Frontend Transport; Tue, 9 Nov 2021 04:39:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4e67433-c33f-4a6f-1cb2-08d9a33af16d X-MS-TrafficTypeDiagnostic: VI1PR04MB5630: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 28SPsiZ0fU6WXywZveR3zjoykero25k30CVbCgELGbTmQZ3uZeUm41lWluVITjJExLF9YCl1xwelfVDGxfJoDVajzNHegi6BlPi1qiQxfcqX8briW5wk/4Ntisp0zeBiSmFcolbGuuAw1HsK1ZVcvFRHuLCvkqPoYP6mGdIBPrgFVP5I8Cq6+FN0f3Yhi8io+Qlt5HeSZJIf4P4S/wMQpvsttWJdCApDNh84+4q3G1+5fRMmJ66uPvCUarW86/ikZKV2CnM5cQMz2owZwDbWM4kQyn2kGUTcPf8vMIJ3MbLOYCWkAGJ0uQkIXbhhCLsdXm/9/rIoDnky9pHfTf5esFQUeKXkLk2LwHMowWBS5Y7rGyyI5peQTW3AuqBrq4RZzQCKgHgPBSC7Q7JVTNrpoMV/Ch06qs51hv1FX9Eevm+AnkWi2qoQQZegov1qFmcljfKZ62qvP1NeAAAoH7JSTBhnnS0qbDwsgb59yAeuAK37ayAwe9cXn1Ikgiuum63awBdPoUWV0sKa96mS5RohI+CBv1XLT/C6DSSZFkpnU14XRDWwtcHr93DnOjT1oM+/5xhwDoylan12aebKI/5sUu1CusF7PSj9bdbYxoKXfQyIusIZqqnoGv7E7z0838ZMhwGjw+x/eozf0FDWxK2fWE5yTIy24sEZ0enNXKrGcXZI+R62W9hyJ7xr4IAZ0hxAaonxwvJjFpsbttL0d9FMYTeXpiVZlFjFmgdF7oHao8hYqejEm6CA73z0URGPqNMtxfv/mHV6/SjUWQ6gj+rd3t5te2fOHB52fjPypEiUcTx1eX+uy3el8kG2FUNICWex 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)(55236004)(1006002)(6666004)(66946007)(26005)(52116002)(7696005)(186003)(316002)(508600001)(1076003)(66556008)(2616005)(5660300002)(66476007)(8936002)(86362001)(956004)(4326008)(6916009)(2906002)(38350700002)(8676002)(36756003)(6486002)(83380400001)(38100700002)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OqO8BDA/aOOBbBVJxWl7xdgae1B1+UAajXIQjdLbjDrwg5elHulyanzAwHCp?= =?us-ascii?Q?Ci9LkK89sAWS61GhA4mOfEHJOr75PctekZjIeB2a8HbgwW6tM3Z36iwNAPUR?= =?us-ascii?Q?xSUXrpuWjIFI0YjuPQUxFrcNSiE/cswbaXZT++Oye11JJ9DOAeKRy+FYt1u/?= =?us-ascii?Q?PAcdjWsTrWlqn+hUk7acILpVqvyBkbWPLCne/rADqZGNT+iDuvFQW6BpoHhZ?= =?us-ascii?Q?JZ1Mo8O+PcyCn1c8CdXtjCQAutWTl5IyNMaQOGsS7oNjFu8roNWILOqhcZb8?= =?us-ascii?Q?9g3N6/wXKuOCc63s3Wd5ocCNqB6vw0WxXI1nnFaIKlaLJqxb9568C45gWStB?= =?us-ascii?Q?bjzSHp8jxIHS9GzA+A0DhPZySbV49n6e/ZvaygP+c8kVHoEJG+yHK7Nhw5mj?= =?us-ascii?Q?8HW7WRAPKIpYsMOqbheAhuKvVNv2KdX4XjEcX3urxybYctOEDEdQA+z53dUo?= =?us-ascii?Q?k6VD8eflVEKZDKHdI3PqQMr4PmqnlNs/wepnnaI62KY/i/iM5fDcY8THZ6Zk?= =?us-ascii?Q?iGYys/XlbRcHKoKyWTbjysdBvlGGdIThffsayF3JhUC9cKe5LIRGtQKoDVVb?= =?us-ascii?Q?JZ62Y9G1H6K+o0zHd/Aazvl8L79MwTKUKJ54EhCOk5AeL8b71AOsVXPtPA1V?= =?us-ascii?Q?dPOv8oWRXaEvukepyEZlOz0dNhS4+W51fnCMKTYuWE7UNlUi3NnMkBIH0gvU?= =?us-ascii?Q?iI6SmiVplP4y/44XeNJ9rIUnFL45fE91v6IL2tnM8s/G26D9mLVJDZXv3YEA?= =?us-ascii?Q?Zanm/1yxJ+yoPF2cYu4poD5vDqmmk20Bbg+wTpqYUBJxI6z3ToBhJKoIHsi9?= =?us-ascii?Q?8bfR7xTexpP/RZ6vw8xqV/w1rcbDCmyXYgsmiL0vI19QI7tN8yyHWxcfNF72?= =?us-ascii?Q?YjuZGfMi7x8H20H6CYdG8ngYw3VyzODVlwtndDx6CIRmVEPuBc+uXsh3mkzx?= =?us-ascii?Q?AOwklXvrejBs6pgmTtzRq599fZGe2bBY+ABsRqA8U23oAiZXwSO1QJH5D3Uj?= =?us-ascii?Q?uywHzf5fgJn7OnhOKZHpAGNc3/LVZEQN3cQqNQ0LujmIZz6uUvVBtwcAOBEt?= =?us-ascii?Q?424sp0zyKBw2FkdZBK/0/IuF6eI6jlTWgXB3/RkrJ21n71FRfXFP1R9/CXFl?= =?us-ascii?Q?+JNQG6DmBILdiZj5477UigYfmfY5XLaCmFub+6NY1YW8pHAA0CIp/i/t7tfR?= =?us-ascii?Q?L6EXtfqg0Vfstd3t/NQZx/Yx9GIzAJSSWM9wfIg/v1jC0nejtuC3uN3dtr5v?= =?us-ascii?Q?ZkJ/kQRGLfVKoHFo/tn5C5Wwh3c6ec9v10+GIY1jyssc4w3UyEtZndJH/ecW?= =?us-ascii?Q?28Wd+dn+UVTOv2cimDXON+hh5BgYNtZq7PKL46iEqimK0MapAxcFa0rpK7V5?= =?us-ascii?Q?BjejRT6U5osR7xn7fp0lXWIoiHlY1iqzk015NwawpJIApTSD7Bmo5NYqv+u+?= =?us-ascii?Q?Pe1uXm/R7M6JngMZI9Sn2gRU3fHRHK0BepHtGfAtgYu8eHuT9McUax/JnCFt?= =?us-ascii?Q?vXRg9CNhFydzke0OgzV7op1yF8Tf3Kt5CMNIX6f6PHS29Uw/MDdTV6+8peEx?= =?us-ascii?Q?62ooxIjfhh9DttCUW7g=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4e67433-c33f-4a6f-1cb2-08d9a33af16d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 04:39:40.7668 (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: 2wnQKRQoI7SMznsH4CdHUVG9f/V0b0VOzQ6UiU3jxq80l00MBbdaeV9GHNvJhB9w X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5630 Subject: [dpdk-dev] [PATCH v4 1/5] 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 | 11 ++++++ doc/guides/dmadevs/dpaa.rst | 54 ++++++++++++++++++++++++++ doc/guides/dmadevs/index.rst | 1 + 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 | 29 ++++++++++++++ drivers/dma/dpaa/dpaa_qdma_logs.h | 46 ++++++++++++++++++++++ drivers/dma/dpaa/meson.build | 14 +++++++ drivers/dma/dpaa/version.map | 4 ++ drivers/dma/meson.build | 1 + 12 files changed, 192 insertions(+) create mode 100644 doc/guides/dmadevs/dpaa.rst create mode 100644 drivers/dma/dpaa/dpaa_qdma.c create mode 100644 drivers/dma/dpaa/dpaa_qdma_logs.h create mode 100644 drivers/dma/dpaa/meson.build create mode 100644 drivers/dma/dpaa/version.map diff --git a/MAINTAINERS b/MAINTAINERS index e157e12f88..0f333b7baa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1377,6 +1377,17 @@ 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/ +F: doc/guides/dmadevs/dpaa.rst + + Packet processing ----------------- diff --git a/doc/guides/dmadevs/dpaa.rst b/doc/guides/dmadevs/dpaa.rst new file mode 100644 index 0000000000..885a8bb8aa --- /dev/null +++ b/doc/guides/dmadevs/dpaa.rst @@ -0,0 +1,54 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright 2021 NXP + +NXP DPAA DMA Driver +===================== + +The DPAA DMA 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. + +The QDMA controller transfers blocks of data between one source and one +destination. The blocks of data transferred can be represented in memory +as contiguous or noncontiguous using scatter/gather table(s). + +More information can be found at `NXP Official Website +`_. + +Supported DPAA SoCs +-------------------- + +- LS1046A +- LS1043A + +Prerequisites +------------- + +See :doc:`../platform/dpaa` for setup information + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +.. note:: + + Some part of dpaa bus code (qbman and fman - library) routines are + dual licensed (BSD & GPLv2), however they are used as BSD in DPDK in userspace. + +Compilation +------------ + +For builds using ``meson`` and ``ninja``, the driver will be built when the +target platform is dpaa-based. No additional compilation steps are necessary. + +Initialization +-------------- + +On EAL initialization, DPAA DMA devices will be detected on DPAA bus and +will be probed and populated into their device list. + + +Platform Requirement +~~~~~~~~~~~~~~~~~~~~ + +DPAA DMA driver for DPDK can only work on NXP SoCs as listed in the +``Supported DPAA SoCs``. diff --git a/doc/guides/dmadevs/index.rst b/doc/guides/dmadevs/index.rst index c2aa6058e6..6b6406f590 100644 --- a/doc/guides/dmadevs/index.rst +++ b/doc/guides/dmadevs/index.rst @@ -12,6 +12,7 @@ an application through DMA API. :numbered: cnxk + dpaa hisilicon idxd ioat diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 01923e2deb..ba6ad7bf16 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..29a6ec2fb3 --- /dev/null +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -0,0 +1,29 @@ +/* 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); +RTE_LOG_REGISTER_DEFAULT(dpaa_qdma_logtype, INFO); diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h new file mode 100644 index 0000000000..01d4a508fc --- /dev/null +++ b/drivers/dma/dpaa/dpaa_qdma_logs.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021 NXP + */ + +#ifndef __DPAA_QDMA_LOGS_H__ +#define __DPAA_QDMA_LOGS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int dpaa_qdma_logtype; + +#define DPAA_QDMA_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \ + fmt "\n", ## args) + +#define DPAA_QDMA_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, dpaa_qdma_logtype, "dpaa_qdma: %s(): " \ + fmt "\n", __func__, ## args) + +#define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>") + +#define DPAA_QDMA_INFO(fmt, args...) \ + DPAA_QDMA_LOG(INFO, fmt, ## args) +#define DPAA_QDMA_ERR(fmt, args...) \ + DPAA_QDMA_LOG(ERR, fmt, ## args) +#define DPAA_QDMA_WARN(fmt, args...) \ + DPAA_QDMA_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) + +#define DPAA_QDMA_DP_DEBUG(fmt, args...) \ + DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args) +#define DPAA_QDMA_DP_INFO(fmt, args...) \ + DPAA_QDMA_DP_LOG(INFO, fmt, ## args) +#define DPAA_QDMA_DP_WARN(fmt, args...) \ + DPAA_QDMA_DP_LOG(WARNING, fmt, ## args) + +#ifdef __cplusplus +} +#endif + +#endif /* __DPAA_QDMA_LOGS_H__ */ 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 ebac25d35f..7cdd6cd28f 100644 --- a/drivers/dma/meson.build +++ b/drivers/dma/meson.build @@ -3,6 +3,7 @@ drivers = [ 'cnxk', + 'dpaa', 'hisilicon', 'idxd', 'ioat', -- 2.25.1