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 4D46743F3A for ; Sun, 28 Apr 2024 17:52:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41FCA40279; Sun, 28 Apr 2024 17:52:50 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 4011540263; Sun, 28 Apr 2024 17:52:48 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0C0501E2ED; Sun, 28 Apr 2024 17:52:48 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 004C31E3B9; Sun, 28 Apr 2024 17:52:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.3 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id A13861E43D; Sun, 28 Apr 2024 17:52:46 +0200 (CEST) Message-ID: <1a65e90a-a54b-4584-bc00-a568d7c11f78@lysator.liu.se> Date: Sun, 28 Apr 2024 17:52:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ethdev: document that stats reset APIs are not thread-safe To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Stephen Hemminger Cc: Ferruh Yigit , Thomas Monjalon , Andrew Rybchenko , dev@dpdk.org, stable@dpdk.org, =?UTF-8?Q?Mattias_R=C3=B6nnblom?= References: <20240425165308.1078454-1-ferruh.yigit@amd.com> <98CBD80474FA8B44BF855DF32C47DC35E9F3F7@smartserver.smartshare.dk> <20240426081334.1a24577d@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F3FA@smartserver.smartshare.dk> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F3FA@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 2024-04-26 17:17, Morten Brørup wrote: >> From: Stephen Hemminger [mailto:stephen@networkplumber.org] >> Sent: Friday, 26 April 2024 17.14 >> >> On Fri, 26 Apr 2024 14:20:01 +0200 >> Morten Brørup wrote: >> >>>> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com] >>>> Sent: Thursday, 25 April 2024 18.53 >>>> >>>> Making 'rte_eth_stats_reset()' and 'rte_eth_xstats_reset()' APIs thread >>>> safe has performance impact on datapath. >>>> >>>> Instead document APIs as not thread safe and add condition for reliable >>>> stats reset functionality, forwarding should be stopped. >>> >>> I'm not sure stopping forwarding suffices. >>> NIC hardware counters will keep progressing unless RX and TX is stopped at >> NIC level. >>> >>> I don't have any suggestions for a better wording, though. :-( >>> >>> Anyway, better with the patch than without... >>> Acked-by: Morten Brørup >>> >> >> The safest option would be: >> rte_eth_dev_stop >> rte_eth_stats_reset >> rte_eth_dev_start > > Yes, but this will cause packet loss. > Network admins should be able to clear the counters without causing packet loss. > For sure, and they would do it via some O&M interface, which would in turn talk the control plane, which in turn would talk to the data plane (including ). Either the control plane or the O&M layer could keep track of a reset offset. Doesn't have to be on the PMD level.