From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eads, Gage" Subject: Re: [PATCH v2 1/1] eal: add 128-bit cmpxchg (x86-64 only) Date: Mon, 4 Mar 2019 20:47:04 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E541F1710@FMSMSX108.amr.corp.intel.com> References: <20190128172945.27251-1-gage.eads@intel.com> <20190222154640.22029-1-gage.eads@intel.com> <20190222154640.22029-2-gage.eads@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "olivier.matz@6wind.com" , "arybchenko@solarflare.com" , "Richardson, Bruce" , "Ananyev, Konstantin" , "Gavin Hu (Arm Technology China)" , nd , "chaozhu@linux.vnet.ibm.com" , "jerinj@marvell.com" , "hemant.agrawal@nxp.com" , nd To: Honnappa Nagarahalli , "dev@dpdk.org" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AA9F12C17 for ; Mon, 4 Mar 2019 21:47:06 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" [snip] > > +/** > > + * An atomic compare and set function used by the mutex functions. > > + * (Atomically) Equivalent to: > > + * if (*dst =3D=3D exp) > Should be, "if (*dst =3D=3D *exp)" >=20 > > + * *dst =3D src > Should be "*dst =3D *src" >=20 Good catches, will fix both. > > + * else > > + * *exp =3D *dst > > + * > > + * @note The success and failure arguments must be one of the > > +__ATOMIC_* values > > + * defined in the C++11 standard. For details on their behavior, > > +refer to the > > + * standard. > > + * > > + * @param dst > > + * The destination into which the value will be written. > > + * @param exp > > + * Pointer to the expected value. If the operation fails, this memor= y is > > + * updated with the actual value. > > + * @param src > > + * Pointer to the new value. > > + * @param weak > > + * A value of true allows the comparison to spuriously fail and allo= ws the > > + * 'exp' update to occur non-atomically (i.e. a torn read may occur)= . > > + * Implementations may ignore this argument and only implement the > strong > > + * variant. > > + * @param success > > + * If successful, the operation's memory behavior conforms to this (= or a > > + * stronger) model. > > + * @param failure > > + * If unsuccessful, the operation's memory behavior conforms to this= (or a > > + * stronger) model. This argument cannot be __ATOMIC_RELEASE, > > + * __ATOMIC_ACQ_REL, or a stronger model than success. > > + * @return > > + * Non-zero on success; 0 on failure. > > + */ > > +static inline int __rte_experimental > > +rte_atomic128_cmpxchg(rte_int128_t *dst, > Name could be more neutral. May be rte_atomic128_compare/cmp_exchange? >=20 > > + rte_int128_t *exp, > > + const rte_int128_t *src, > > + unsigned int weak, > > + int success, > > + int failure); > > +#endif > > + > > #endif /* _RTE_ATOMIC_H_ */ > > -- > > 2.13.6 >=20 Sure -- I'll rename it rte_atomic128_cmp_exchange in the next version. > Few minor comments. > I have not reviewed the x86 implementation. > Otherwise, > Reviewed-by: Honnappa Nagarahalli Thanks, Gage