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 69675A0C54; Fri, 3 Sep 2021 15:03:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94ECF40E78; Fri, 3 Sep 2021 15:03:54 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 1D99040E78 for ; Fri, 3 Sep 2021 15:03:51 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10095"; a="198959995" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="198959995" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 06:03:51 -0700 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="689638445" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.26.152]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 03 Sep 2021 06:03:47 -0700 Date: Fri, 3 Sep 2021 14:03:44 +0100 From: Bruce Richardson To: Chengwen Feng Cc: thomas@monjalon.net, ferruh.yigit@intel.com, jerinj@marvell.com, jerinjacobk@gmail.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, mb@smartsharesystems.com, nipun.gupta@nxp.com, hemant.agrawal@nxp.com, maxime.coquelin@redhat.com, honnappa.nagarahalli@arm.com, david.marchand@redhat.com, sburla@marvell.com, pkapoor@marvell.com, konstantin.ananyev@intel.com, conor.walsh@intel.com Message-ID: References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-2-git-send-email-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1630588395-2804-2-git-send-email-fengchengwen@huawei.com> Subject: Re: [dpdk-dev] [PATCH v19 1/7] dmadev: introduce DMA device library public APIs 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 Thu, Sep 02, 2021 at 09:13:09PM +0800, Chengwen Feng wrote: > The 'dmadevice' is a generic type of DMA device. > > This patch introduce the 'dmadevice' public APIs which expose generic > operations that can enable configuration and I/O with the DMA devices. > > Maintainers update is also included in this patch. > > Signed-off-by: Chengwen Feng > Acked-by: Bruce Richardson > Acked-by: Morten Brørup > Acked-by: Jerin Jacob > --- > MAINTAINERS | 4 + > doc/api/doxy-api-index.md | 1 + > doc/api/doxy-api.conf.in | 1 + > doc/guides/rel_notes/release_21_11.rst | 5 + > lib/dmadev/meson.build | 4 + > lib/dmadev/rte_dmadev.h | 949 +++++++++++++++++++++++++++++++++ > lib/dmadev/version.map | 24 + > lib/meson.build | 1 + > 8 files changed, 989 insertions(+) > create mode 100644 lib/dmadev/meson.build > create mode 100644 lib/dmadev/rte_dmadev.h > create mode 100644 lib/dmadev/version.map > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Trigger hardware to begin performing enqueued operations. > + * > + * This API is used to write the "doorbell" to the hardware to trigger it > + * to begin the operations previously enqueued by rte_dmadev_copy/fill(). > + * > + * @param dev_id > + * The identifier of the device. > + * @param vchan > + * The identifier of virtual DMA channel. > + * > + * @return > + * 0 on success. Otherwise negative value is returned. > + */ > +__rte_experimental > +int > +rte_dmadev_submit(uint16_t dev_id, uint16_t vchan); > + Putting this out here for discussion: Those developers here looking at how integration of dma acceleration into vhost-virtio e.g. for OVS use, have come back with the request that we provide a method for querying the amount of space in the descriptor ring, or the size of the next burst, or similar. Basically, the reason for the ask is to allow an app to determine if a set of jobs of size N can be enqueued before the first one is, so that we don't get a half-offload of copy of a multi-segment packet (for devices where scatter-gather is not available). In our "ioat" rawdev driver, we did this by providing a "burst_capacity" API which returned the number of elements which could be enqueued in the next burst without error (normally the available ring space). Looking at the dmadev APIs, an alternative way to do this is to extend the "submit()" function to allow a 3rd optional parameter to return this info. That is, when submitting one burst of operations, you get info about how many more you can enqueue in the next burst. [For submitting packets via the submit flag, this info would not be available, as I feel ending all enqueue operations would be excessive]. Therefore, I see a number of options for us to meet the ask for space querying API: 1. provide a capacity API as done with ioat driver 2. provide (optional) capacity information from each submit() call 3. provide both #1 and #2 above as they are compatible 4. For me, I think #3 is probably the most flexible approach. The benefit of #2 is that the info can be provided to the application much more cheaply than when the app has to call a separate API (which wouldn't be on the fast-path). However, a way to provide the info apart from submitting a burst would also be helpful, hence adding the extra function too (#1). What are other people's thoughts or ideas on this? Regards, /Bruce