From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA28344037; Wed, 15 May 2024 17:03:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FE27402BE; Wed, 15 May 2024 17:03:17 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 49CA84021D for ; Wed, 15 May 2024 17:03:16 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1f08442b7bcso17952725ad.1 for ; Wed, 15 May 2024 08:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715785395; x=1716390195; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=QQUR0fUlfrrRvIUNAhLhDOx4JFSjZtgLyhhGcnh+52c=; b=coDBq/HROygQE77x7jQb3bJHK04iPioQuEDNHlu9exFU61jCuypK2rntwSxo+Bj0CR zwHmMse4ElgAw7paNWyldNmqiXg48oXgh/v2RxxUV6eJ1kYAKwAcdtiRGKzLjqT+sAfs 7Tm+JS87dG4kaeu4HFUDLe+I7+7AopXSJoXnTYJHFDEdf0XbGSy5BRFB3mLYzSVg1d0N XFXqeizMjuF4QtQ/g6ZkAdku6u+Qn6myp09n07G+c1PK1bSz84yuI7NaEE1MVMIaAcxN +gdxP54bE27fcmzKWAC3WFNSVIk6XPQG4fNTCvdUF3yfE+IVj/ynlLyQ7jQpVpq5/BM8 AyJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715785395; x=1716390195; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QQUR0fUlfrrRvIUNAhLhDOx4JFSjZtgLyhhGcnh+52c=; b=bOP78tScZ2OwWWldUeDUCgWa5Bu6BSL+dDu2+/OxdVO189smg7k+PmeLge+rCbwh1E +pQmX8PQVX72OZYR84pNOziJkJLhxoFkce1nwJAN+kvQJdrspqAVd8WUCZ88bj6blTT6 OaJgsJ/tQoae9Yw+oAOuzCV6/gDYJIDXZqsckqZV4YfO0BulZcdvCcJe4Wwb/TudWMOw 6T12jnJKvcFYWYBGuNRiN03WiDJbSfeXYF0cQDwV/CZPA2FtSsGw3rqKEzHk+l3uaw4t VtkY33Q+bDxwSIS6Pwat3syGLpUbTAjpx0QsaaZnEhrjV/GxYdPR8ab/ies7PHnV1K/L MTTQ== X-Gm-Message-State: AOJu0YwCHMN1ETHngtCPm+JWD7oIl4qolPm6qJSY4I+vCA87WSEz4nx3 XEOaVlOvzOJP567GhLomg8v6xv+L9hh1Gjd0tt6jeKJrBmHzn4rUwZFEW9IyK0U= X-Google-Smtp-Source: AGHT+IH3ioLRInvBXxfA00oFQ7kf4arNSDSetWSvWzPwhJdE7g5JqTy5cAh8ohOpOWKnO5Tf0MbiTA== X-Received: by 2002:a17:902:f791:b0:1e5:5be8:15af with SMTP id d9443c01a7336-1ef43d2972fmr209807865ad.17.1715785395194; Wed, 15 May 2024 08:03:15 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c160a1esm120101355ad.279.2024.05.15.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 08:03:14 -0700 (PDT) Date: Wed, 15 May 2024 08:03:11 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: , Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Mattias =?UTF-8?B?UsO2bm5ibG9t?= , "Ferruh Yigit" , Subject: Re: [PATCH v3 1/7] eal: generic 64 bit counter Message-ID: <20240515080311.2f06ef30@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F454@smartserver.smartshare.dk> References: <20240510050507.14381-1-stephen@networkplumber.org> <20240514153845.42489-1-stephen@networkplumber.org> <20240514153845.42489-2-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F454@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, 15 May 2024 11:30:45 +0200 Morten Br=C3=B8rup wrote: > With a long term perspective, I consider this patch very useful. > And its 32 bit implementation can be optimized for various architectures/= compilers later. >=20 >=20 > In addition, it would be "nice to have" if reset() and fetch() could be c= alled from another thread than the thread adding to the counter. >=20 > As previously discussed [1], I think it can be done without significantly= affecting fast path add() performance, by using an "offset" with Release-C= onsume ordering. >=20 > [1]: https://inbox.dpdk.org/dev/98CBD80474FA8B44BF855DF32C47DC35E9F427@sm= artserver.smartshare.dk/ >=20 Without a specific driver use case, not sure why this added complexity is n= eeded. If there is a specific example, can add it later. Any atomic operation ends= up impacting the speculative execution pipeline on modern CPU's. This version ends up being just a single add instruction on ARM and x86 64 bit.