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 3636644045; Fri, 17 May 2024 05:30:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19FDF402C2; Fri, 17 May 2024 05:30:41 +0200 (CEST) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by mails.dpdk.org (Postfix) with ESMTP id 25A774029B for ; Fri, 17 May 2024 05:30:40 +0200 (CEST) Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3c9963a2205so560374b6e.2 for ; Thu, 16 May 2024 20:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715916639; x=1716521439; 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=dteKt0/NWKMcNtJYswIA2TM02fv/rjScLCBto5mtLNQ=; b=R15h81C3Mi0cBhzB58g3YZOD6O6WIfu0I/w9G0WnIk8Fdge+UxZRmglTdFpCxXqs0s dGaKKo5IhLiTFZQ+G9ePNL1XU2nI1H6nx1KNSoGdQBOhGzlrulUOkL5wbTaPsYcmlCJY zasqZ590sjSjC+Xj1wuaoRp9+OHLC5qwTjgTEtM5GifOfnzNJrcv4yznrPJ2LacLfXkz sjcM53qZp24tj+O67f+FlZflvqMF5mItBADCa/Z4G3fEhFefFUA1lDkuYYNa9IbHI8BF biRqoUMh9kOd/wuz9ENqllAigXzKTKSlVMd/TQ33Z1nFJLlKY0YWcxVcDstJGK9xZW37 +b4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715916639; x=1716521439; 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=dteKt0/NWKMcNtJYswIA2TM02fv/rjScLCBto5mtLNQ=; b=JkdOYUAdplMj6EsamWBLadac5M0sOSc8yE0BwMfEvdW6IuVKK/TikVBkSG8J+A7Y1F JTBaA7h6Z9BZc1WKBAuSeU21eGXzs5GF15tM3FDHT/3NUAAX9wgc3/dnJXBgsQp7B1aO C715PAQxURLhTK+KPcavWXfRISCvnjvBe+6TTAHLRH3C09+HEg7zgE9/aXiqBOZZy2ZS DL6jilG362MXIDvGlC7PY/dGtWAXgB6XXwuur8kiNaQBrLIw7PtxJzt/SKJPF/KzfkVL hf6S9wZjBhdso4MxL9rddOUhXn1oTNa3hjSh8KS1cGMayKBixp1sBUSFLmD/K4JYgVeF BZYg== X-Gm-Message-State: AOJu0YzgN1wwxBRGiMNAM0wL8RVpieiEux5XxtXxj7pTnhNfbb9g7tqb 2urWvQLy4dYqNmWAhWYKCvPOiRp64S/z0xfREm76PA8/1BjxjdcoM//JDI8RooPiHTQFeTtjcId eb/c= X-Google-Smtp-Source: AGHT+IF/TInaVWZL/MOIVKpBon5jyaGAT3yx/4zR7rt3bcHwga1WM/wEzaUhDNswR0EygYj11sYl0Q== X-Received: by 2002:aca:2412:0:b0:3c6:574:eb45 with SMTP id 5614622812f47-3c9970bcd49mr21896051b6e.45.1715916639357; Thu, 16 May 2024 20:30:39 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2ade2besm14234640b3a.98.2024.05.16.20.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 20:30:39 -0700 (PDT) Date: Thu, 16 May 2024 20:30:37 -0700 From: Stephen Hemminger To: Honnappa Nagarahalli Cc: "dev@dpdk.org" , Morten =?UTF-8?B?QnLDuHJ1cA==?= , nd Subject: Re: [PATCH v6 1/9] eal: generic 64 bit counter Message-ID: <20240516203037.73ec13e1@hermes.local> In-Reply-To: <48ED00A3-1CCA-4F64-ACC3-CA1F0D2B9378@arm.com> References: <20240510050507.14381-1-stephen@networkplumber.org> <20240517001302.65514-1-stephen@networkplumber.org> <20240517001302.65514-2-stephen@networkplumber.org> <48ED00A3-1CCA-4F64-ACC3-CA1F0D2B9378@arm.com> 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 Fri, 17 May 2024 02:45:12 +0000 Honnappa Nagarahalli wrote: > > + * A counter is 64 bit value that is safe from split read/write > > + * on 32 bit platforms. It assumes that only one cpu at a time > If we are defining the counter in this manner, then implementation cannot be generic. I think architectures will have constraints if they have to ensure the 64b variables are not split. > > I think we at least need the counter to be aligned on 8B boundary to have generic code. The C standard has always guaranteed that read and write to unsigned log will not be split. Therefore if arch is 64 bit native there is no need for atomics