> -----Original Message----- > From: dev <dev-boun...@dpdk.org> On Behalf Of Chengwen Feng > Sent: Tuesday, June 15, 2021 21:22 > To: tho...@monjalon.net; Yigit, Ferruh <ferruh.yi...@intel.com> > Cc: dev@dpdk.org; nipun.gu...@nxp.com; hemant.agra...@nxp.com; > maxime.coque...@redhat.com; > honnappa.nagaraha...@arm.com; jer...@marvell.com; david.march...@redhat.com; > Richardson, Bruce > <bruce.richard...@intel.com>; jerinjac...@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 <fengcheng...@huawei.com> > --- > 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 ? The API can be rte_dma_dev_get_dev_id ... Just a suggestion. ;-) > +rte_dmadev_pmd_release(struct rte_dmadev *dev); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _RTE_DMADEV_PMD_H_ */ > -- > 2.8.1