On Fri, 26 Jan 2018 17:24:40 +0000
Bruce Richardson <bruce.richard...@intel.com> wrote:

> On Fri, Jan 26, 2018 at 06:14:01PM +0100, Thomas Monjalon wrote:
> > 26/01/2018 03:01, Stephen Hemminger:  
> > > To handle atomic update of link status (64 bit), every driver was
> > > doing its own version using cmpset.  Atomic exchange is a useful
> > > primitive in its own right; therefore make it a EAL routine.
> > > 
> > > Signed-off-by: Stephen Hemminger <step...@networkplumber.org> ---
> > > .../common/include/arch/ppc_64/rte_atomic.h        | 21 +++++-
> > > .../common/include/arch/x86/rte_atomic.h           | 24 +++++++
> > > .../common/include/arch/x86/rte_atomic_32.h        | 12 ++++
> > > .../common/include/arch/x86/rte_atomic_64.h        | 12 ++++
> > > lib/librte_eal/common/include/generic/rte_atomic.h | 78
> > > ++++++++++++++++++++++ 5 files changed, 146 insertions(+), 1
> > > deletion(-)  
> > 
> > Looks good, thanks.
> > 
> > It probably deserves a review by PPC experts.  Adding Chao, maintainer
> > of this part.  + Bruce and Konstantin for x86 part.
> >   
> Would it not be simpler to use __sync_bool_compare_and_swap compiler
> built-in on all supported platforms? Do we really need the per-platform
> optimization of this?
> 
> /Bruce

Exchange is different than compare and swap. The is nice atomic intrinsic
in GCC. The x86 part is in Linux and BSD already.

Reply via email to