> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Bruce Richardson > Sent: Thursday, 9 September 2021 16.29 > > On Thu, Sep 09, 2021 at 09:54:27PM +0800, fengchengwen wrote: > > On 2021/9/9 20:45, Bruce Richardson wrote: > > > On Thu, Sep 09, 2021 at 01:29:33PM +0200, Thomas Monjalon wrote: > > >> 09/09/2021 13:18, Bruce Richardson: > > >>> On Thu, Sep 09, 2021 at 12:33:00PM +0200, Thomas Monjalon wrote: > > >>>> 07/09/2021 14:56, Chengwen Feng:
[snip] > > >>>>> +bool > > >>>>> +rte_dmadev_is_valid_dev(uint16_t dev_id); > > >>>> > > >>>> I would suggest dropping the final "_dev" in the function name. > > >>>> > > >>> > > >>> The alternative, which I would support, is replacing "rte_dmadev" > with > > >>> "rte_dma" across the API. This would then become > "rte_dma_is_valid_dev" > > >>> which is clearer, since the dev is not part of the standard > prefix. It also > > >>> would fit in with a possible future function of > "rte_dma_is_valid_vchan" > > >>> for instance. > > >> > > >> Yes > > >> The question is whether it would make sense to reserver rte_dma_ > prefix > > >> for some DMA functions which would be outside of dmadev lib? > > >> If you think that all DMA functions will be in dmadev, > > >> then yes we can shorten the prefix to rte_dma_. > > >> > > > > > > Well, any DPDK dma functions which are not in dma library should > have the > > > prefix of the library they are in e.g. rte_eal_dma_*, rte_pci_dma_* > > > Therefore, I don't think name conflicts should be an issue, and I > like > > > having less typing to do in function names (and I believe Morten > was > > > strongly proposing this previously too) > > > > The dmadev is rather short, if change I prefer all public API with > rte_dma_ prefix, > > and don't have rte_dma_dev_ prefix for such start/stop/close. (ps: > the rte_eth_ also > > have rte_eth_dev_close which is painful for OCD). > > I agree that having rte_dma_dev_* is unpleasant naming for those > functions, > so if we use rte_dma_ as prefix, any dev should be at the end instead: > i.e. rte_dma_stop_dev, rte_dma_start_dev, rte_dma_close_dev, etc. > I agree about using rte_dma_ as general prefix. But I disagree about rte_dma_<action>_<object>() function names, such as rte_dma_stop_dev(). We should follow the convention of rte_dma_<object>_<action>(), like in the ethdev library, e.g. rte_eth_dev_get(), rte_eth_fec_get_capability(). Or simply rte_dma_<action>(), if the object is obvious and can be omitted. I.e. rte_dma_dev_stop() or rte_dma_stop(). > > > > Also should the filename(e.g. rte_dmadev.h) and directory- > name(lib/dmadev) also change ? > > > I would keep those names intact. Keep intact, as Bruce suggests. This also aligns with the ethdev library. > > /Bruce