09/11/2021 05:39, Gagandeep Singh:
> 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 <g.singh@nxp.com>
> ---
> --- 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 <g.singh@nxp.com>
> +M: Nipun Gupta <nipun.gupta@nxp.com>
> +F: drivers/dma/dpaa/
> +F: doc/guides/dmadevs/dpaa.rst
> +
> +
There is already a section for DMA drivers.
> Packet processing
> -----------------
>
[...]
> --- /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
> +=====================
There are other occurences in this patch of a lack of attention.
Doing underlining of correct length is a minimum when starting a doc.
> --- 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
> ------------
The new features should be inside this section and well sorted.
There are a lot of other details that I won't report.
All of this look to be on purpose, or a big negligence.
In any case, it looks to me as sending some junk work to my face.
I am too kind, so I will fix all, and will merge after the deadline passed.
But please remember that I don't forget such attitude,
and I think other maintainers won't forget as well.
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, November 9, 2021 8:15 PM
> To: Gagandeep Singh <G.Singh@nxp.com>
> Cc: dev@dpdk.org; Nipun Gupta <nipun.gupta@nxp.com>;
> david.marchand@redhat.com; ferruh.yigit@intel.com; gakhil@marvell.com;
> Hemant Agrawal <hemant.agrawal@nxp.com>
> Subject: Re: [dpdk-dev] [PATCH v4 1/5] dma/dpaa: introduce DPAA DMA driver
>
> 09/11/2021 05:39, Gagandeep Singh:
> > 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 <g.singh@nxp.com>
> > ---
> > --- 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 <g.singh@nxp.com>
> > +M: Nipun Gupta <nipun.gupta@nxp.com>
> > +F: drivers/dma/dpaa/
> > +F: doc/guides/dmadevs/dpaa.rst
> > +
> > +
>
> There is already a section for DMA drivers.
>
> > Packet processing
> > -----------------
> >
> [...]
> > --- /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
> > +=====================
>
> There are other occurences in this patch of a lack of attention.
> Doing underlining of correct length is a minimum when starting a doc.
>
> > --- 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
> > ------------
>
> The new features should be inside this section and well sorted.
>
> There are a lot of other details that I won't report.
> All of this look to be on purpose, or a big negligence.
> In any case, it looks to me as sending some junk work to my face.
>
> I am too kind, so I will fix all, and will merge after the deadline passed.
> But please remember that I don't forget such attitude,
> and I think other maintainers won't forget as well.
>
I accept my mistakes. This happens while rebasing the patches in very last
moment.
There was no such intention to send junk work to the maintainer. I sent the first
Version of the series when the DMA APIs were still in review and at that time
There was no section " Dmadev Drivers" in the maintainers so I added it
and also release notes were at the right place. But while rebasing at the
very last moment, I forgot to pay attention to details.
Thank you for being so kind. I will take care of all these details next time.
@@ -1377,6 +1377,17 @@ F: drivers/raw/dpaa2_qdma/
F: doc/guides/rawdevs/dpaa2_qdma.rst
+
+Dmadev Drivers
+--------------
+
+NXP DPAA DMA
+M: Gagandeep Singh <g.singh@nxp.com>
+M: Nipun Gupta <nipun.gupta@nxp.com>
+F: drivers/dma/dpaa/
+F: doc/guides/dmadevs/dpaa.rst
+
+
Packet processing
-----------------
new file mode 100644
@@ -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
+<http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_.
+
+Supported DPAA SoCs
+--------------------
+
+- LS1046A
+- LS1043A
+
+Prerequisites
+-------------
+
+See :doc:`../platform/dpaa` for setup information
+
+- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` 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``.
@@ -12,6 +12,7 @@ an application through DMA API.
:numbered:
cnxk
+ dpaa
hisilicon
idxd
ioat
@@ -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
------------
@@ -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:
@@ -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;
@@ -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); \
new file mode 100644
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2021 NXP
+ */
+
+#include <rte_dpaa_bus.h>
+
+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);
new file mode 100644
@@ -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__ */
new file mode 100644
@@ -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
new file mode 100644
@@ -0,0 +1,4 @@
+DPDK_22 {
+
+ local: *;
+};
@@ -3,6 +3,7 @@
drivers = [
'cnxk',
+ 'dpaa',
'hisilicon',
'idxd',
'ioat',