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

Wang, Haiyue haiyue.wang at intel.com
Wed Jun 16 10:16:08 CEST 2021


> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson at intel.com>
> Sent: Wednesday, June 16, 2021 16:05
> To: Wang, Haiyue <haiyue.wang at intel.com>
> Cc: Chengwen Feng <fengchengwen at huawei.com>; thomas at monjalon.net; Yigit, Ferruh
> <ferruh.yigit at intel.com>; dev at dpdk.org; nipun.gupta at nxp.com; hemant.agrawal at nxp.com;
> maxime.coquelin at redhat.com; honnappa.nagarahalli at arm.com; jerinj at marvell.com;
> david.marchand at redhat.com; jerinjacobk at gmail.com; Xia, Chenbo <chenbo.xia at intel.com>
> Subject: Re: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library
> 
> On Wed, Jun 16, 2021 at 03:17:51AM +0100, Wang, Haiyue wrote:
> > > -----Original Message-----
> > > From: dev <dev-bounces at dpdk.org> On Behalf Of Chengwen Feng
> > > Sent: Tuesday, June 15, 2021 21:22
> > > To: thomas at monjalon.net; Yigit, Ferruh <ferruh.yigit at intel.com>
> > > Cc: dev at dpdk.org; nipun.gupta at nxp.com; hemant.agrawal at nxp.com; maxime.coquelin at redhat.com;
> > > honnappa.nagarahalli at arm.com; jerinj at marvell.com; david.marchand at redhat.com; Richardson, Bruce
> > > <bruce.richardson at intel.com>; jerinjacobk at 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 <fengchengwen at 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 ?
> 
> 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.


More information about the dev mailing list