From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CEAF1A0C48; Wed, 16 Jun 2021 10:04:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 546124067A; Wed, 16 Jun 2021 10:04:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1E9E440140 for ; Wed, 16 Jun 2021 10:04:52 +0200 (CEST) IronPort-SDR: h605SUfMx+n2yujlmzPJ0//lEP47EAr13NUfYetxvfGXf+GKp3t29DM4X/fTIrb52hKS0eisxM sECSaI9iWedg== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="193255150" X-IronPort-AV: E=Sophos;i="5.83,277,1616482800"; d="scan'208";a="193255150" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2021 01:04:50 -0700 IronPort-SDR: eoaCIX9TWjPnGtyTNX+xwK3W4m21Fg5xR61JlXjCIuUydcK6GOFd8Uht+mxPkihIIFlPfB2Nlk f2iYgYe74ZWg== X-IronPort-AV: E=Sophos;i="5.83,277,1616482800"; d="scan'208";a="415667251" Received: from mwhelan-mobl2.ger.corp.intel.com (HELO bricha3-MOBL.ger.corp.intel.com) ([10.252.12.169]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 16 Jun 2021 01:04:47 -0700 Date: Wed, 16 Jun 2021 09:04:43 +0100 From: Bruce Richardson To: "Wang, Haiyue" Cc: Chengwen Feng , "thomas@monjalon.net" , "Yigit, Ferruh" , "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" Message-ID: References: <1623763327-30987-1-git-send-email-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 16, 2021 at 03:17:51AM +0100, Wang, Haiyue wrote: > > -----Original Message----- > > From: dev On Behalf Of Chengwen Feng > > Sent: Tuesday, June 15, 2021 21:22 > > To: thomas@monjalon.net; Yigit, Ferruh > > 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 > > ; 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 > > --- > > 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 > > +#include > > +#include > > +#include > > + > > +/** > > + * @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 strongly we can revisit later.