[v2,1/6] dma/dpaa: introduce DPAA DMA driver
Checks
Commit Message
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>
---
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
Comments
On 2021/11/1 16:51, Gagandeep Singh wrote:
> 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>
[snip]
> +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',
suggest use space replace tab, and add dpaa before skeleton
> ]
> std_deps = ['dmadev']
>
02/11/2021 09:51, fengchengwen:
> On 2021/11/1 16:51, Gagandeep Singh wrote:
> > 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>
>
> [snip]
>
> > +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',
>
> suggest use space replace tab, and add dpaa before skeleton
I think alphabetically sorted would be better?
@@ -1353,6 +1353,16 @@ 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/
+
+
Packet processing
-----------------
@@ -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,28 @@
+/* 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);
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: *;
+};
@@ -5,5 +5,6 @@ drivers = [
'idxd',
'ioat',
'skeleton',
+ 'dpaa',
]
std_deps = ['dmadev']