From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 4190C1B4E0 for ; Wed, 3 Apr 2019 21:04:44 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BDCB72210A; Wed, 3 Apr 2019 15:04:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2019 15:04:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=VT6CMWzc43Ts/mJCyDnYNUS0ZJaxCsBosMHJ3WpLvjo=; b=HFaVw69FUuRf KBQakrsL48H2cxj2bZHAi2xNYXzIqInFB7+YqoI3W9dL1Dkp2iP5BbCYyHthaCBt NUnkz2mLet+rU2vTiTQMNZGOL2qbou0ePll/oUOztTC7Y4FR8/nMmqyKbVBJs156 4/dN8V88KXu3R8CVdv/OYLY2BuS/S14= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=VT6CMWzc43Ts/mJCyDnYNUS0ZJaxCsBosMHJ3WpLv jo=; b=Y04P6nUyEoW39/YqCm7PCzt80K5riCcb6fmLf5fj/N975T2lkpc4ZVNlm T5PvgaUV2F09OaSnD/KYveaXhHYKtGWJGG8eM4tCgJcavLv8dL61+HUQwQJojtEf GX9tftICg9kPaIs6iwa7LLqYcf3+yhjesyXM+rAUiEqOeoAMo0tGZMjcIV899IhB 7Kw7tuUt60ckQzf6NV/MDQzz4rlxtqH8DVK2QzLoN2UXsNrDozfjbqwfMPAj2UTR Bjt6RKUfnSxni1RJa2DLqYnBMCaoPcLYLqnD6LcR4Ti2ZO+8RhlvUkDdRVpnnGj4 IYpg1jcnXQhh7lmuT3x9Zj0MdmWJA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdefgddutdeiucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttddv necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 46D79E4176; Wed, 3 Apr 2019 15:04:41 -0400 (EDT) From: Thomas Monjalon To: Gage Eads Cc: dev@dpdk.org, olivier.matz@6wind.com, arybchenko@solarflare.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, gavin.hu@arm.com, Honnappa.Nagarahalli@arm.com, nd@arm.com, chaozhu@linux.vnet.ibm.com, jerinj@marvell.com, hemant.agrawal@nxp.com Date: Wed, 03 Apr 2019 21:04:39 +0200 Message-ID: <2974113.GYloSpOT6o@xps> In-Reply-To: <20190403173438.23691-2-gage.eads@intel.com> References: <20190304205133.2248-1-gage.eads@intel.com> <20190403173438.23691-1-gage.eads@intel.com> <20190403173438.23691-2-gage.eads@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 1/1] eal: add 128-bit compare exchange (x86-64 only) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 19:04:44 -0000 03/04/2019 19:34, Gage Eads: > This operation can be used for non-blocking algorithms, such as a > non-blocking stack or ring. > > Signed-off-by: Gage Eads > Reviewed-by: Honnappa Nagarahalli > --- > --- a/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h > +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h > +/** > + * An atomic compare and set function used by the mutex functions. > + * (Atomically) Equivalent to: > + * if (*dst == *exp) > + * *dst = *src > + * else > + * *exp = *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 memory 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 allows 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_cmp_exchange(rte_int128_t *dst, > + rte_int128_t *exp, > + const rte_int128_t *src, > + unsigned int weak, > + int success, > + int failure) I was thinking about keeping the doxygen in the generic file. Is it possible? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 907FEA0679 for ; Wed, 3 Apr 2019 21:04:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B42BB1B4EF; Wed, 3 Apr 2019 21:04:45 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 4190C1B4E0 for ; Wed, 3 Apr 2019 21:04:44 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BDCB72210A; Wed, 3 Apr 2019 15:04:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2019 15:04:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=VT6CMWzc43Ts/mJCyDnYNUS0ZJaxCsBosMHJ3WpLvjo=; b=HFaVw69FUuRf KBQakrsL48H2cxj2bZHAi2xNYXzIqInFB7+YqoI3W9dL1Dkp2iP5BbCYyHthaCBt NUnkz2mLet+rU2vTiTQMNZGOL2qbou0ePll/oUOztTC7Y4FR8/nMmqyKbVBJs156 4/dN8V88KXu3R8CVdv/OYLY2BuS/S14= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=VT6CMWzc43Ts/mJCyDnYNUS0ZJaxCsBosMHJ3WpLv jo=; b=Y04P6nUyEoW39/YqCm7PCzt80K5riCcb6fmLf5fj/N975T2lkpc4ZVNlm T5PvgaUV2F09OaSnD/KYveaXhHYKtGWJGG8eM4tCgJcavLv8dL61+HUQwQJojtEf GX9tftICg9kPaIs6iwa7LLqYcf3+yhjesyXM+rAUiEqOeoAMo0tGZMjcIV899IhB 7Kw7tuUt60ckQzf6NV/MDQzz4rlxtqH8DVK2QzLoN2UXsNrDozfjbqwfMPAj2UTR Bjt6RKUfnSxni1RJa2DLqYnBMCaoPcLYLqnD6LcR4Ti2ZO+8RhlvUkDdRVpnnGj4 IYpg1jcnXQhh7lmuT3x9Zj0MdmWJA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdefgddutdeiucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttddv necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 46D79E4176; Wed, 3 Apr 2019 15:04:41 -0400 (EDT) From: Thomas Monjalon To: Gage Eads Cc: dev@dpdk.org, olivier.matz@6wind.com, arybchenko@solarflare.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, gavin.hu@arm.com, Honnappa.Nagarahalli@arm.com, nd@arm.com, chaozhu@linux.vnet.ibm.com, jerinj@marvell.com, hemant.agrawal@nxp.com Date: Wed, 03 Apr 2019 21:04:39 +0200 Message-ID: <2974113.GYloSpOT6o@xps> In-Reply-To: <20190403173438.23691-2-gage.eads@intel.com> References: <20190304205133.2248-1-gage.eads@intel.com> <20190403173438.23691-1-gage.eads@intel.com> <20190403173438.23691-2-gage.eads@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 1/1] eal: add 128-bit compare exchange (x86-64 only) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190403190439.dhq6If_-3RDOFTb2BQR82ikU5fED5YXSE2WYIa8WrLg@z> 03/04/2019 19:34, Gage Eads: > This operation can be used for non-blocking algorithms, such as a > non-blocking stack or ring. > > Signed-off-by: Gage Eads > Reviewed-by: Honnappa Nagarahalli > --- > --- a/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h > +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h > +/** > + * An atomic compare and set function used by the mutex functions. > + * (Atomically) Equivalent to: > + * if (*dst == *exp) > + * *dst = *src > + * else > + * *exp = *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 memory 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 allows 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_cmp_exchange(rte_int128_t *dst, > + rte_int128_t *exp, > + const rte_int128_t *src, > + unsigned int weak, > + int success, > + int failure) I was thinking about keeping the doxygen in the generic file. Is it possible?