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 60F51A034F; Fri, 8 Oct 2021 09:14:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFE3E40685; Fri, 8 Oct 2021 09:14:02 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id DD62A4067E for ; Fri, 8 Oct 2021 09:14:01 +0200 (CEST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HQfXp1vmWzPjyt; Fri, 8 Oct 2021 15:12:58 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 8 Oct 2021 15:13:59 +0800 Received: from [127.0.0.1] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 8 Oct 2021 15:13:59 +0800 To: Thomas Monjalon CC: , , , , , , , , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <20210924105357.15386-1-fengchengwen@huawei.com> <20210924105357.15386-2-fengchengwen@huawei.com> <11670203.VNtdCpnXh1@thomas> From: fengchengwen Message-ID: Date: Fri, 8 Oct 2021 15:13:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <11670203.VNtdCpnXh1@thomas> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v23 1/6] 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 2021/10/6 18:26, Thomas Monjalon wrote: > 24/09/2021 12:53, Chengwen Feng: >> The 'dmadevice' is a generic type of DMA device. > > Do you mean 'dmadev' ? > >> This patch introduce the 'dmadevice' device allocation APIs. >> >> The infrastructure is prepared to welcome drivers in drivers/dma/ > > Good > > [...] >> +The DMA library provides a DMA device framework for management and provisioning >> +of hardware and software DMA poll mode drivers, defining generic APIs which [snip] > > [...] >> +++ b/lib/dmadev/rte_dmadev.h >> + * The dmadev are dynamically allocated by rte_dma_pmd_allocate() during the >> + * PCI/SoC device probing phase performed at EAL initialization time. And could >> + * be released by rte_dma_pmd_release() during the PCI/SoC device removing >> + * phase. > > I don't think this text has value, > and we could imagine allocating a device ata later stage. Yes, we could remove the stage descriptor because it's a well-known knowledge, but I recommend keeping the rte_dma_pmd_allocate and rte_dma_pmd_release functions, how about: * The dmadev are dynamically allocated by rte_dma_pmd_allocate(). And could * be released by rte_dma_pmd_release(). > > [...] >> + * Configure the maximum number of dmadevs. >> + * @note This function can be invoked before the primary process rte_eal_init() >> + * to change the maximum number of dmadevs. > > You should mention what is the default. > Is the default exported to the app in this file? The default macro is RTE_DMADEV_DEFAULT_MAX_DEVS, and I place it at rte_config.h. I think it's better to focus on one place (rte_config.h) than to modify config in multiple places (e.g. rte_dmadev.h/rte_xxx.h). > >> + * >> + * @param dev_max >> + * maximum number of dmadevs. >> + * >> + * @return >> + * 0 on success. Otherwise negative value is returned. >> + */ >> +__rte_experimental >> +int rte_dma_dev_max(size_t dev_max); > > What about a function able to do more with the name rte_dma_init? > It should allocate the inter-process shared memory, > and do the lookup in case of secondary process. Yes, we defined dma_data_prepare() which do above thing, it's in 4th patch. Because we could not invoke some like allocate inter-process shared memory before rte_eal_init, so I think it's better keep rte_dma_dev_max as it is. > >> +/** >> + * @warning >> + * @b EXPERIMENTAL: this API may change without prior notice. >> + * >> + * Get the device identifier for the named DMA device. >> + * >> + * @param name >> + * DMA device name. >> + * >> + * @return >> + * Returns DMA device identifier on success. >> + * - <0: Failure to find named DMA device. >> + */ >> +__rte_experimental >> +int rte_dma_get_dev_id(const char *name); > > Should we add _by_name? > We could have a function to retrieve the ID by devargs as well. > >> +++ b/lib/dmadev/rte_dmadev_core.h >> +/** >> + * @file >> + * >> + * DMA Device internal header. >> + * >> + * This header contains internal data types, that are used by the DMA devices >> + * in order to expose their ops to the class. >> + * >> + * Applications should not use these API directly. > > If it is not part of the API, it should not be exposed at all. > Why not having all these stuff in a file dmadev_driver.h? > Is it used by some inline functions? Yes, it's used by dataplane inline functions. [snip] > . > Thanks