[dpdk-dev] [PATCH v3 1/3] rwlock: reimplement with atomic builtins

Gavin Hu (Arm Technology China) Gavin.Hu at arm.com
Fri Mar 15 04:04:47 CET 2019


Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Thursday, March 14, 2019 11:54 PM
> To: Joyce Kong (Arm Technology China) <Joyce.Kong at arm.com>
> Cc: dev at dpdk.org; nd <nd at arm.com>; Gavin Hu (Arm Technology China)
> <Gavin.Hu at arm.com>; jerinj at marvell.com; konstantin.ananyev at intel.com;
> chaozhu at linux.vnet.ibm.com; bruce.richardson at intel.com;
> thomas at monjalon.net; hemant.agrawal at nxp.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>
> Subject: Re: [dpdk-dev] [PATCH v3 1/3] rwlock: reimplement with atomic
> builtins
> 
> On Thu, 14 Mar 2019 21:15:02 +0800
> Joyce Kong <joyce.kong at arm.com> wrote:
> 
> > -		success = rte_atomic32_cmpset((volatile uint32_t *)&rwl-
> >cnt,
> > -					      (uint32_t)x, (uint32_t)(x + 1));
> > +		success = __atomic_compare_exchange_n(&rwl->cnt, &x,
> x+1, 1,
> > +					__ATOMIC_ACQUIRE,
> __ATOMIC_RELAXED);
> 
> Would it be possible to have rte_atomic32_cmpset be an inline function
> that became __atomic_comppare_exchange? Then all usages would be the
> same.

There is already a patch for this and Honnappa commented on this: 
https://mails.dpdk.org/archives/dev/2019-January/124297.html




More information about the dev mailing list