Thread (339 messages) 339 messages, 17 authors, 2021-10-17

Re: [dpdk-dev] [PATCH v21 1/7] dmadev: introduce DMA device library public APIs

From: Morten Brørup <hidden>
Date: 2021-09-09 15:12:41

From: dev [mailto:dev-bounces@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:
quoted
On 2021/9/9 20:45, Bruce Richardson wrote:
quoted
On Thu, Sep 09, 2021 at 01:29:33PM +0200, Thomas Monjalon wrote:
quoted
09/09/2021 13:18, Bruce Richardson:
quoted
On Thu, Sep 09, 2021 at 12:33:00PM +0200, Thomas Monjalon wrote:
quoted
07/09/2021 14:56, Chengwen Feng:
[snip]
quoted
quoted
quoted
quoted
quoted
quoted
+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
quoted
quoted
quoted
quoted
"rte_dma" across the API. This would then become
"rte_dma_is_valid_dev"
quoted
quoted
quoted
quoted
which is clearer, since the dev is not part of the standard
prefix. It also
quoted
quoted
quoted
quoted
would fit in with a possible future function of
"rte_dma_is_valid_vchan"
quoted
quoted
quoted
quoted
for instance.
Yes
The question is whether it would make sense to reserver rte_dma_
prefix
quoted
quoted
quoted
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
quoted
quoted
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
quoted
quoted
having less typing to do in function names (and I believe Morten
was
quoted
quoted
strongly proposing this previously too)
The dmadev is rather short, if change I prefer all public API with
rte_dma_ prefix,
quoted
and don't have rte_dma_dev_ prefix for such start/stop/close. (ps:
the rte_eth_ also
quoted
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().
quoted
Also should the filename(e.g. rte_dmadev.h) and directory-
name(lib/dmadev) also change ?
quoted
I would keep those names intact.
Keep intact, as Bruce suggests. This also aligns with the ethdev library.
/Bruce
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help