From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 5/5] examples/kni: improve zeroing statistics Date: Thu, 27 Sep 2018 12:40:25 +0100 Message-ID: <1bc03874-f981-f5f2-e071-76c4fc1da96e@intel.com> References: <20180911232906.18352-1-dg@adax.com> <20180919195549.5585-1-dg@adax.com> <20180919195549.5585-6-dg@adax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Igor Ryzhov , Stephen Hemminger To: Dan Gora Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7643C1B448 for ; Thu, 27 Sep 2018 13:40:28 +0200 (CEST) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/26/2018 3:48 PM, Dan Gora wrote: > On Wed, Sep 26, 2018 at 11:01 AM, Ferruh Yigit wrote: >> On 9/19/2018 8:55 PM, Dan Gora wrote: >>> The worker threads incrementing the rx/tx_packets race with the signal >>> handler from the main thread zeroing the entire statistics structure. >>> This can cause the statistics to fail to be zeroed, even when there >>> is no traffic on those interfaces. >>> >>> Improve zeroing the statistics by only incrementing rx/tx_packets >>> in worker threads by a non-zero amount. This limits the race to the >>> periods in which traffic is actually being received or transmitted. >> >> Not sure about introducing an extra check to datapath for possible error on >> stats zero. I am for dropping this patch, what do you think? > > This is literally adding one instruction to the datapath. Not even an > atomic instruction. There is no effect on the performance caused by > this change. > > Is that not better than the user (like me who experienced this) > wondering why they cannot zero the counters even when there is no > traffic? Can we have something like, stop the forwarding, clear the stats and start forwarding back? Yes effect is small but it is for each packet, it doesn't make sense to me to add extra check for each packet for the rare case of stats reset.