From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2018 04:40:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,310,1534834800"; d="scan'208";a="266236073" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.39]) ([10.237.221.39]) by fmsmga005.fm.intel.com with ESMTP; 27 Sep 2018 04:40:26 -0700 To: Dan Gora Cc: dev@dpdk.org, Igor Ryzhov , Stephen Hemminger References: <20180911232906.18352-1-dg@adax.com> <20180919195549.5585-1-dg@adax.com> <20180919195549.5585-6-dg@adax.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: <1bc03874-f981-f5f2-e071-76c4fc1da96e@intel.com> Date: Thu, 27 Sep 2018 12:40:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 5/5] examples/kni: improve zeroing statistics X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 11:40:28 -0000 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.