Thread (79 messages) 79 messages, 10 authors, 2021-07-06

Re: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library

From: Wang, Haiyue <hidden>
Date: 2021-06-16 08:16:21

-----Original Message-----
From: Richardson, Bruce <redacted>
Sent: Wednesday, June 16, 2021 16:05
To: Wang, Haiyue <redacted>
Cc: Chengwen Feng <redacted>; thomas@monjalon.net; Yigit, Ferruh
[off-list ref]; dev@dpdk.org; nipun.gupta@nxp.com; hemant.agrawal@nxp.com;
maxime.coquelin@redhat.com; honnappa.nagarahalli@arm.com; jerinj@marvell.com;
david.marchand@redhat.com; jerinjacobk@gmail.com; Xia, Chenbo [off-list ref]
Subject: Re: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library

On Wed, Jun 16, 2021 at 03:17:51AM +0100, Wang, Haiyue wrote:
quoted
quoted
-----Original Message-----
From: dev <redacted> On Behalf Of Chengwen Feng
Sent: Tuesday, June 15, 2021 21:22
To: thomas@monjalon.net; Yigit, Ferruh <redacted>
Cc: dev@dpdk.org; nipun.gupta@nxp.com; hemant.agrawal@nxp.com; maxime.coquelin@redhat.com;
honnappa.nagarahalli@arm.com; jerinj@marvell.com; david.marchand@redhat.com; Richardson, Bruce
[off-list ref]; jerinjacobk@gmail.com
Subject: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library

This patch introduces 'dmadevice' which is a generic type of DMA
device.

The APIs of dmadev library exposes some generic operations which can
enable configuration and I/O with the DMA devices.

Signed-off-by: Chengwen Feng <redacted>
---
 lib/dmadev/rte_dmadev.h     | 531 ++++++++++++++++++++++++++++++++++++++++++++
 lib/dmadev/rte_dmadev_pmd.h | 384 ++++++++++++++++++++++++++++++++
 2 files changed, 915 insertions(+)
 create mode 100644 lib/dmadev/rte_dmadev.h
 create mode 100644 lib/dmadev/rte_dmadev_pmd.h
diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h
new file mode 100644
index 0000000..ca7c8a8
--- /dev/null
+++ b/lib/dmadev/rte_dmadev.h
@@ -0,0 +1,531 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2021 HiSilicon Limited.
+ */
+
+#ifndef _RTE_DMADEV_H_
+#define _RTE_DMADEV_H_
+
+/**
+ * @file rte_dmadev.h
+ *
+ * DMA (Direct Memory Access) device APIs.
+ *
+ * Defines RTE DMA Device APIs for DMA operations and its provisioning.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_common.h>
+#include <rte_memory.h>
+#include <rte_errno.h>
+#include <rte_compat.h>
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Get the total number of DMA devices that have been successfully
+ * initialised.
+ *
+ * @return
+ *   The total number of usable DMA devices.
+ */
+__rte_experimental
+uint16_t
+rte_dmadev_count(void);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Get the device identifier for the named DMA device.
+ *
+ * @param name
+ *   DMA device name to select the DMA device identifier.
+ *
+ * @return
+ *   Returns DMA device identifier on success.
+ *   - <0: Failure to find named DMA device.
+ */
+__rte_experimental
+int
+rte_dmadev_get_dev_id(const char *name);
+
Like 'struct rte_pci_device', 'struct rte_vdev_device', and new introduced
'struct rte_auxiliary_device', have the "rte_xxx_device" name style,
How about 'struct rte_dma_device' name ?
One difference is that the pci, vdev and auxiliary devices are all devices
types on a bus, rather than devices in a functional class like ethdev,
rawdev, eventdev. I think what is here is fine for now - if you feel
From this point of view, yes, it's fine. Thanks, Bruce.
strongly we can revisit later.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help