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 1145343F5D; Wed, 1 May 2024 18:43:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA6E04027F; Wed, 1 May 2024 18:43:07 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 78AA14021E for ; Wed, 1 May 2024 18:43:06 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5f415fd71f8so5525336a12.3 for ; Wed, 01 May 2024 09:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714581785; x=1715186585; 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=WAvYha926c9lo7/8VN45eEwSG008GePihTQZ3Uh9Jc4=; b=Kh6g0/ewxx2KAzkXrRJYlVYB9DeJcrtVELPGIPCWnO9KFvvGYHO8krwuANpBdmUmRU ZG7r4N+ul9F1vIcUGEnqAFngm3hlO7R/GcHO5qdU32oThzjee6lC7vTRZC/PCboShmnU AOEiA9DO5kU9QIoSn5RT30GgwOYcMkXGWYzhxlzKIFBLhwDbOfmXI9nMzK9uWivgHZef msztRh9zNr7k3DXtO/6Iu9Ux76IkCPPxvDt9NangIYJfaH9Z1xWYm8Jx5piEUNxuzFPt +Jh4jjznnZcwS4G6Dq0drYwcQpAFH6HOH8BBCrjYY1aBQuCq9UXdL28UFFVoIMW7HXMl 7aAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714581785; x=1715186585; 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=WAvYha926c9lo7/8VN45eEwSG008GePihTQZ3Uh9Jc4=; b=vlT5UQAENRxmSnhrICswoO4LsG7SnHQOfbYkLWa5nTS3Ycohu+oTBCVmPzkvPdSdiQ XSryIIsgpB2nWAzJU/YXZuavcjlvtP1/Ae6U3BeOfm5Iwm85P22yK2gyalAg69TVMFB1 yQiBXSmXbiqAMTRcWfeizo3OL3U93jySkvA3YEvwMEnNTVl0qkUo/+x3mFYzv1OwHtGx MPyVQDVKjyT4KUCC4abBMdtCuiZyCklyDbYUaX7XBhXod1nxzwXz6CiL2xHzvikYE9Iq 7YboO7QCnI6G48hhVFMRRqs/bIx5+1S0BpMBGlL0Kl+fIjRxj4PEPdNzCL6UftxOcTkX GRNg== X-Gm-Message-State: AOJu0Yx2f4ZmUL9CDV40YLzZu/B1Vi89Mw3ssoA80zx3RXTh1ivgtKoM xEknXkfrBH33Lp0YT+rbCjj2/iifVA+d3yDZS5fy8znSYqOr/UlT8KKbzXNapPc= X-Google-Smtp-Source: AGHT+IHadZlo1lprryEiKoW0t3JprfjVPODMUWmWzoov2KcfchzIPDZvMCDNuTPipTIBXrlUUfbV1A== X-Received: by 2002:a17:90b:3b4a:b0:2b2:c84e:9124 with SMTP id ot10-20020a17090b3b4a00b002b2c84e9124mr3009928pjb.45.1714581785515; Wed, 01 May 2024 09:43:05 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id r12-20020a17090ad40c00b002a676e286d9sm1539627pju.43.2024.05.01.09.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 09:43:05 -0700 (PDT) Date: Wed, 1 May 2024 09:43:03 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org, "John W. Linville" , Mattias =?UTF-8?B?UsO2bm5ibG9t?= Subject: Re: [PATCH] net/af_packet: fix statistics Message-ID: <20240501094303.751e95b4@hermes.local> In-Reply-To: <9025199c-585c-4779-9f4e-360845707088@amd.com> References: <20240430154129.7347-1-stephen@networkplumber.org> <9025199c-585c-4779-9f4e-360845707088@amd.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 Wed, 1 May 2024 17:25:59 +0100 Ferruh Yigit wrote: > > - Do not mark statistics as volatile. > > Instead, READ_ONCE() where necessary. > > > > I did similar [1], and Mattias has some comments on it. > Issue is not in the reader (stats_get) side. Without volatile writer > (datapath thread) may end up *not* storing updated stats to memory. > > For reader side, I expect value not been in the register when function > called, so it ends up reading from memory, which doesn't require > volatile casting. These are per-queue stats, and anybody foolish enough to have multiple threads sharing same queue without locking is playing with fire. It is documented that DPDK PMD's don't support that.