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 0F77A45AB0; Sat, 5 Oct 2024 00:27:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 378FE432CA; Sat, 5 Oct 2024 00:27:58 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 30BE44028B for ; Sat, 5 Oct 2024 00:27:57 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-20b9b35c7c7so18907065ad.1 for ; Fri, 04 Oct 2024 15:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728080876; x=1728685676; 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=009671oSyt19lg+6ENGMdkkTrfwfCaUn55QTMDH6FYA=; b=lc55kIugqTY87N+9+34ArqG+DaVCZRTUENKcPCTp5QMO//osUdeCSoDXani9Z83Rr+ Yw4r0K0fIAsbR3UOKejPJnbnoQCDT7NZntZM4S0JmAKBFKFLfmM2AIjuPp0I6UMoZmVA F4yOEHksU+z2ntqgUW8PpKvw9CsIBHV07OZe9n1RiIDy8RA9O27pYHsPMRi7NZ8c2aUa Q0gSf79K89ADyzeEjzBe78g9D6Iw0igvJbcdQrXg5JC7ZqWGnG9Euvf9LQg6TrZ3xmFs Axy+hf04ja4xNY95AqrS4ucCRrSshNVg+DhKhSgpEW3s9Bow29SwnXLNJ18x+z4z/7RT lGbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728080876; x=1728685676; 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=009671oSyt19lg+6ENGMdkkTrfwfCaUn55QTMDH6FYA=; b=k8FzdvOaZUWBaEu+TsSPkGwf9/XRcrCdDxeinLRDHWeDdkN/tapO+CTGzmIcU8J9De GUtYKIhNS6QGDx0Ub2mtrHwijaNscK9CvQj1t7YNbJk+9hq4URZWzjUBci+08vidJXL9 zn8iOQaTho1LIRPVI5y8V9UVwSFCx5kdsS0oJfSzNCyvZc6/mn1lGUGDC8Agy6bPoo19 wUAExbmKACq93cCu994YHmOMHehFqwuWW2MUN8/bhQgvaTgNGmO1yoS5dAStFgU2BlVX ZhLjWwy6vpKHS83TU2kKOz5jKFdyZ13m4aEG4n0/MDzLA5lmO2w/luhGxCUies1CtecK PICA== X-Forwarded-Encrypted: i=1; AJvYcCXyqudo+SZd7rt4zIYHQ4vduoM8HQDVVY/hAse5Z7cSgrslxCrw5w5HH+iB865FjJait60=@dpdk.org X-Gm-Message-State: AOJu0YyUdTxwcty9AsJGP7QmCisBipcEYSgL6cU/6FFyTsR6WFGLhtpN JCQBZOpUH66ftNRT2R/xRStE4hvv7khLh2oxPkJoWPr89ByhAKe2rb1j8lZQCzU= X-Google-Smtp-Source: AGHT+IGZRF8ELdNad6XvS8rabAkHx/FgT7E4Xb5u8sGiCq571XzyJQ/mQyUPWiksGpTWh4NOgouUiQ== X-Received: by 2002:a17:902:d2cf:b0:20b:502f:8c2e with SMTP id d9443c01a7336-20bfee333acmr61972415ad.51.1728080876348; Fri, 04 Oct 2024 15:27:56 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c13939e08sm3261025ad.146.2024.10.04.15.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 15:27:56 -0700 (PDT) Date: Fri, 4 Oct 2024 15:27:54 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: Thomas Monjalon , Andrew Rybchenko , , , Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Morten =?UTF-8?B?QnLDuHJ1cA==?= Subject: Re: [PATCH] ethdev: document that stats reset APIs are not thread-safe Message-ID: <20241004152754.10e35605@hermes.local> In-Reply-To: <20240425165308.1078454-1-ferruh.yigit@amd.com> References: <20240425165308.1078454-1-ferruh.yigit@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 Thu, 25 Apr 2024 17:53:08 +0100 Ferruh Yigit wrote: > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 548fada1c7ad..40f04c0e191b 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -3136,6 +3136,9 @@ int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); > /** > * Reset the general I/O statistics of an Ethernet device. > * > + * API is not multi-thread safe. > + * Application should stop forwarding before calling this API. > + * > * @param port_id > * The port identifier of the Ethernet device. > * @return Putting a note in the documentation is good, but it would be better to be more explicit about what happens if used unsafely. Something like adding a not to stats_reset like. * Resetting the statistics while device is active is not an atomic operation; * doing a reset while forwarding may lead to inconsistent counter values.