[dpdk-dev] [PATCH v8 2/3] devtools: prevent use of rte atomic APIs in future patches

Stephen Hemminger stephen at networkplumber.org
Sat Jul 18 04:18:28 CEST 2020


On Fri, 17 Jul 2020 22:48:04 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com> wrote:

> > > > Don't we want to convert all libs?  
> > > The goal is to convert all the libs.
> > >  
> > > > If we are adding one more rte_atomic in a lib, we should ask the
> > > > question why not converting to C11, no?  
> > > Agree, I am fine with this approach. That will kind of distribute the  
> > conversion work as well.  
> > >  
> > > >  
> > > > > 2. Keep non-converted modules compatible. C11 atomic builtins
> > > > > cannot be  
> > > > used directly for rte_atomicXX_t variables.  
> > > > >
> > > > > The cons are :
> > > > > 1. The list needs updating every time we convert a module.  
> > > This list will go away once all the modules are converted.
> > >  
> > > > > 2. The script is not elegant as before.  
> > > >
> > > >  
> > >  
> > 
> > Can't the conversion just be automated with something coccinelle?  
> I do not know what 'coccinelle' means, not much help on the internet as well.
> 
> I really have not thought about automation. But, working on these conversions, I have realized that understanding of the synchronizations used is required (basically, understanding the entire module) to ensure the correct barriers are used. We could use the most strongest barrier and functionality would be fine, but the performance would take a hit.

coccinelle is a semantic patch tool, it allows for changes that are know how to deal
with arguments to functions etc. It is widely used in Linux kernel to do tree wide
changes (for example adding a new argument to an internal function).

https://www.kernel.org/doc/html/latest/dev-tools/coccinelle.html





More information about the dev mailing list