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 00BD9A0C4B; Tue, 13 Jul 2021 15:38:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC00341263; Tue, 13 Jul 2021 15:38:30 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id F2F27406FF for ; Tue, 13 Jul 2021 15:38:28 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10043"; a="197434318" X-IronPort-AV: E=Sophos;i="5.84,236,1620716400"; d="scan'208";a="197434318" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 06:38:24 -0700 X-IronPort-AV: E=Sophos;i="5.84,236,1620716400"; d="scan'208";a="459572458" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.27.49]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 13 Jul 2021 06:37:50 -0700 Date: Tue, 13 Jul 2021 14:37:46 +0100 From: Bruce Richardson To: fengchengwen 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 Message-ID: References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1626179263-14645-1-git-send-email-fengchengwen@huawei.com> <02340ac8-9d09-15e8-3969-1850f08e5831@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <02340ac8-9d09-15e8-3969-1850f08e5831@huawei.com> Subject: Re: [dpdk-dev] [PATCH v3] 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 Tue, Jul 13, 2021 at 09:06:39PM +0800, fengchengwen wrote: > Thank you for your valuable comments, and I think we've taken a big step forward. > > @andrew Could you provide the copyright line so that I can add it to relevant file. > > @burce, jerin Some unmodified review comments are returned here: Thanks. Some further comments inline below. Most points you make I'm ok with, but I do disagree on a number of others. /Bruce > > 1. > COMMENT: We allow up to 100 characters per line for DPDK code, so these don't need > to be wrapped so aggressively. > > REPLY: Our CI still has 80 characters limit, and I review most framework still comply. > Ok. > 2. > COMMENT: > +#define RTE_DMA_MEM_TO_MEM (1ull << 0) > RTE_DMA_DIRECTION_... > > REPLY: add the 'DIRECTION' may the macro too long, I prefer keep it simple. > DIRECTION could be shortened to DIR, but I think this is probably ok as is too. > 3. > COMMENT: > +rte_dmadev_vchan_release(uint16_t dev_id, uint16_t vchan); > We are not making release as pubic API in other device class. See ethdev spec. > bbdev/eventdev/rawdev > > REPLY: because ethdev's queue is hard-queue, and here is the software defined channels, > I think release is OK, BTW: bbdev/eventdev also have release ops. > Ok > 4. COMMENT:> + uint64_t reserved[4]; /**< Reserved for future > fields */ > > +}; > Please add the capability for each counter in info structure as one > device may support all the counters. > > REPLY: This is a statistics function. If this function is not supported, > then do not need to implement the stats ops function. Also could to set > the unimplemented ones to zero. > +1 The stats functions should be a minimum set that is supported by all drivers. Each of these stats can be easily tracked by software if HW support for it is not available, so I agree that we should not have each stat as a capability. > 5. > COMMENT: > +#endif > > + return (*dev->fill)(dev, vchan, pattern, dst, length, flags); > Instead of every driver set the NOP function, In the common code, If > the CAPA is not set, > common code can set NOP function for this with <0 return value. > > REPLY: I don't think it's a good idea to judge in IO path, it's application duty to ensure > don't call API which driver not supported (which could get from capabilities). > For datapath functions, +1. > 6. > COMMENT: > +rte_dmadev_completed_fails(uint16_t dev_id, uint16_t vchan, > > + const uint16_t nb_status, uint32_t *status, > uint32_t -> enum rte_dma_status_code > > REPLY:I'm still evaluating this. It takes a long time for the driver to perform error code > conversion in this API. Do we need to provide an error code conversion function alone ? > It's not that difficult a conversion to do, and so long as we have the regular "completed" function which doesn't do all the error manipulation we should be fine. Performance in the case of errors is not expected to be as good, since errors should be very rare. > 7. > COMMENT: > +typedef int (*dmadev_info_get_t)(struct rte_dmadev *dev, > > + struct rte_dmadev_info *dev_info); > Please change to rte_dmadev_info_get_t to avoid conflict due to namespace issue > as this header is exported. > > REPLY: I prefer not add 'rte_' prefix, it make the define too long. > I disagree on this, they need the rte_ prefix, despite the fact it makes them longer. If length is a concern, these can be changed from "dmadev_" to "rte_dma_", which is only one character longer. In fact, I believe Morten already suggested we use "rte_dma" rather than "rte_dmadev" as a function prefix across the library. > 8. > COMMENT: > + * - rte_dmadev_completed_fails() > > + * - return the number of operation requests failed to complete. > Please rename this to "completed_status" to allow the return of information > other than just errors. As I suggested before, I think this should also be > usable as a slower version of "completed" even in the case where there are > no errors, in that it returns status information for each and every job > rather than just returning as soon as it hits a failure. > > REPLY: well, I think it maybe confuse (current OK/FAIL API is easy to understand.), > and we can build the slow path function on the two API. > I still disagree on this too. We have a "completed" op where we get informed of what has completed and minimal error indication, and a "completed_status" operation which provides status information for each operation completed, at the cost of speed. > 9. > COMMENT: > +#define RTE_DMA_DEV_CAPA_MEM_TO_MEM (1ull << 0) > > +/**< DMA device support mem-to-mem transfer. > Do we need this? Can we assume that any device appearing as a dmadev can > do mem-to-mem copies, and drop the capability for mem-to-mem and the > capability for copying? > also for RTE_DMA_DEV_CAPA_OPS_COPY > > REPLY: yes, I insist on adding this for the sake of conceptual integrity. > For ioat driver just make a statement. > Ok. It seems a wasted bit to me, but I don't see us running out of them soon. > 10. > COMMENT: > + uint16_t nb_vchans; /**< Number of virtual DMA channel configured */ > > +}; > Let's add rte_dmadev_conf struct into this to return the configuration > settings. > > REPLY: If we add rte_dmadev_conf in, it may break ABI when rte_dmadev_conf add fields. > Yes, that is true, but I fail to see why that is a major problem. It just means that if the conf structure changes we have two functions to version instead of one. The information is still useful. If you don't want the actual conf structure explicitly put into the info struct, we can instead put the fields in directly. I really think that the info_get function should provide back to the user the details of what way the device was configured previously. regards, /Bruce