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 0056D43F27; Thu, 16 May 2024 23:42:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7226A4028C; Thu, 16 May 2024 23:42:45 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 79C1540261 for ; Thu, 16 May 2024 23:42:44 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6f44390e328so670103b3a.2 for ; Thu, 16 May 2024 14:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715895763; x=1716500563; 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=jqAJbSb8T0e+HFVdvUXzqePJ7bUzz45WhinuPl6sKTQ=; b=QSvM+CDaI2LI/XlAGpFg2ayz8xA5ZGteRyBnRyPDF0/4sw2NoPr5EGs1XoyOr3ig2P ToSeqYSGUuJElhQPy2lr1/5M9z6dxXH64GzXgAL0kCZwcFsLnl+mZT710BbQGbbui6cY TrAkHMtLCRD7fTfREL9moUINTNl4ldW+q85hjpuVHwq9M1TG03nkw47i/Fq9UWVrD6cC waGN1Q67bgS1dDr0hSg0g6WIq69v/1kcVzGSAZXjA988R6+ztgvcZBSyJbwjpIXl9QYo Tai4CSnhhpfGUdAT9RXJw+D8fjYjCi+kR2wIYiGQQK9aGNUVHMuJF4hrRWbomDVX4qZS w2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715895763; x=1716500563; 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=jqAJbSb8T0e+HFVdvUXzqePJ7bUzz45WhinuPl6sKTQ=; b=w1sTyMlBqJX18IMj2AgJmws6GZs3C7ywJ7ctDOFpR1GyIYgYiib1AdCOIU6PpcJIWv vtfZVYbSopHbkXCVmdYCuRCTKLxmZAku95pVcAhU3YTyVOT6J1qpMhO9k+ZI5KuvFwzD b3l0EzhRozvyGEuwwDRDAl2jPMv8aVAiu8Kgt3ZU98/4sVorQdkObHxDpSzTtj/t1QfX +JbU4mRZD9UeoJWYWkMzGFxT/Q1DRX2AqafMA55kR50GnHY7RgESOUkGLDLKtvy0HGKs gdKWqBNxWdLvLM7VM21Y55QQNtj51NDNOoAwRlxP+KPeBhQOOIFYEwEO3BWaYZzt3Bqg cmhw== X-Gm-Message-State: AOJu0Yyu0JyRqqUj9k6TuZjYl395aqm9xRN+knY5BUKEUVEA5dwTiK7f BrprjuiWDOFUUYD4b18KJqp5ats5sDH9ODxBo0TjXPkHqSmFBZlP5CWj8pp/3zM= X-Google-Smtp-Source: AGHT+IFZqB1BTdnNcX+7QL98evYCcWnGz6z7O0DusJ5RujQaVsNhqPSyjE5SOj9UMEzt+DKOwcBK5g== X-Received: by 2002:a05:6a20:2594:b0:1ae:3f36:28d3 with SMTP id adf61e73a8af0-1afde197878mr31641656637.49.1715895763090; Thu, 16 May 2024 14:42:43 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0b9d18afsm143597555ad.46.2024.05.16.14.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 14:42:42 -0700 (PDT) Date: Thu, 16 May 2024 14:42:41 -0700 From: Stephen Hemminger To: Wathsala Wathawana Vithanage Cc: "dev@dpdk.org" , Morten =?UTF-8?B?QnLDuHJ1cA==?= , nd Subject: Re: [PATCH v5 1/9] eal: generic 64 bit counter Message-ID: <20240516144241.4c287701@hermes.local> In-Reply-To: References: <20240510050507.14381-1-stephen@networkplumber.org> <20240516154327.64104-1-stephen@networkplumber.org> <20240516154327.64104-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Thu, 16 May 2024 18:22:23 +0000 Wathsala Wathawana Vithanage wrote: > Hi Stephen, > > > +__rte_experimental > > +static inline uint64_t > > +rte_counter64_fetch(const rte_counter64_t *counter) { > > + return *counter; > > +} > > What if the address pointed by counter is not aligned and the > architecture doesn't support atomic (untorn) loads on non-aligned loads? > > --wathsala Then the driver is using it incorrectly. For the use case of a set of counters (even if embedded in another struct), the compiler takes care of this. Remember this is an internal API, not something that needs to handle user abuse.